Apply some cleanup with regard to referencing and more

This commit is contained in:
Christian Dywan 2008-10-30 02:21:19 +01:00
parent 0a65f30926
commit 80128d9315
5 changed files with 29 additions and 32 deletions

View file

@ -337,19 +337,13 @@ midori_app_finalize (GObject* object)
g_list_free (app->browsers);
g_object_unref (app->accel_group);
if (app->settings)
g_object_unref (app->settings);
if (app->bookmarks)
g_object_unref (app->bookmarks);
if (app->trash)
g_object_unref (app->trash);
if (app->search_engines)
g_object_unref (app->search_engines);
if (app->history)
g_object_unref (app->history);
katze_object_assign (app->settings, NULL);
katze_object_assign (app->bookmarks, NULL);
katze_object_assign (app->trash, NULL);
katze_object_assign (app->search_engines, NULL);
katze_object_assign (app->history, NULL);
if (app->instance)
g_object_unref (app->instance);
katze_object_assign (app->instance, NULL);
G_OBJECT_CLASS (midori_app_parent_class)->finalize (object);
}
@ -365,27 +359,23 @@ midori_app_set_property (GObject* object,
switch (prop_id)
{
case PROP_SETTINGS:
katze_object_assign (app->settings, g_value_get_object (value));
g_object_ref (app->settings);
katze_object_assign (app->settings, g_value_dup_object (value));
/* FIXME: Propagate settings to all browsers */
break;
case PROP_BOOKMARKS:
katze_object_assign (app->bookmarks, g_value_get_object (value));
g_object_ref (app->bookmarks);
katze_object_assign (app->bookmarks, g_value_dup_object (value));
/* FIXME: Propagate bookmarks to all browsers */
break;
case PROP_TRASH:
katze_object_assign (app->trash, g_value_get_object (value));
g_object_ref (app->trash);
katze_object_assign (app->trash, g_value_dup_object (value));
/* FIXME: Propagate trash to all browsers */
break;
case PROP_SEARCH_ENGINES:
katze_object_assign (app->search_engines, g_value_get_object (value));
g_object_ref (app->search_engines);
katze_object_assign (app->search_engines, g_value_dup_object (value));
/* FIXME: Propagate search engines to all browsers */
break;
case PROP_HISTORY:
katze_object_assign (app->history, g_value_get_object (value));
katze_object_assign (app->history, g_value_dup_object (value));
/* FIXME: Propagate history to all browsers */
break;
default:

View file

@ -261,7 +261,7 @@ midori_panel_set_property (GObject* object,
g_value_get_enum (value));
break;
case PROP_MENU:
katze_object_assign (panel->menu, g_value_get_object (value));
katze_object_assign (panel->menu, g_value_dup_object (value));
/* FIXME: Move existing items to the new menu */
break;
case PROP_PAGE:

View file

@ -17,6 +17,7 @@
#include "sokoke.h"
#include <string.h>
#include <glib/gi18n.h>
struct _MidoriPreferences

View file

@ -946,6 +946,14 @@ webkit_web_view_window_object_cleared_cb (GtkWidget* web_view,
web_frame, js_context, js_window);
}
static void
webkit_web_view_destroy_cb (GtkWidget* web_view,
WebKitWebFrame* web_frame)
{
g_signal_handlers_disconnect_by_func (web_frame,
webkit_web_frame_load_done_cb, gtk_widget_get_parent (web_view));
}
static void
midori_view_init (MidoriView* view)
{
@ -982,7 +990,6 @@ static void
midori_view_finalize (GObject* object)
{
MidoriView* view;
/* WebKitWebFrame* web_frame; */
view = MIDORI_VIEW (object);
@ -1003,11 +1010,6 @@ midori_view_finalize (GObject* object)
katze_object_assign (view->net, NULL);
/* web_frame = webkit_web_view_get_main_frame
(WEBKIT_WEB_VIEW (view->web_view));
g_signal_handlers_disconnect_by_func (web_frame,
webkit_web_frame_load_done, view); */
G_OBJECT_CLASS (midori_view_parent_class)->finalize (object);
}
@ -1045,7 +1047,7 @@ midori_view_set_property (GObject* object,
katze_assign (view->statusbar_text, g_value_dup_string (value));
break;
case PROP_SETTINGS:
midori_view_set_settings (view, g_value_get_object (value));
midori_view_set_settings (view, g_value_dup_object (value));
break;
case PROP_NET:
katze_object_assign (view->net, g_value_dup_object (value));
@ -1261,6 +1263,8 @@ midori_view_construct_web_view (MidoriView* view)
webkit_web_view_console_message_cb, view,
"signal::window-object-cleared",
webkit_web_view_window_object_cleared_cb, view,
"signal::destroy",
webkit_web_view_destroy_cb, web_frame,
NULL);
g_object_connect (web_frame,
"signal::load-done",

View file

@ -6,15 +6,17 @@ import Params
import pproc as subprocess
import os
APPNAME = 'midori'
if bld.env ()['INTLTOOL_UPDATE']:
os.chdir ('./po')
try:
try:
size_old = os.stat ('midori.pot').st_size
size_old = os.stat (APPNAME + '.pot').st_size
except:
size_old = 0
subprocess.call (['intltool-update', '--pot'])
size_new = os.stat ('midori.pot').st_size
size_new = os.stat (APPNAME + '.pot').st_size
if size_new <> size_old:
Params.pprint ('YELLOW', "Updated po template.")
try:
@ -29,4 +31,4 @@ if bld.env ()['INTLTOOL_UPDATE']:
os.chdir ('..')
obj = bld.create_obj ('intltool_po')
obj.appname = 'midori'
obj.appname = APPNAME