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

View file

@ -261,7 +261,7 @@ midori_panel_set_property (GObject* object,
g_value_get_enum (value)); g_value_get_enum (value));
break; break;
case PROP_MENU: 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 */ /* FIXME: Move existing items to the new menu */
break; break;
case PROP_PAGE: case PROP_PAGE:

View file

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

View file

@ -946,6 +946,14 @@ webkit_web_view_window_object_cleared_cb (GtkWidget* web_view,
web_frame, js_context, js_window); 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 static void
midori_view_init (MidoriView* view) midori_view_init (MidoriView* view)
{ {
@ -982,7 +990,6 @@ static void
midori_view_finalize (GObject* object) midori_view_finalize (GObject* object)
{ {
MidoriView* view; MidoriView* view;
/* WebKitWebFrame* web_frame; */
view = MIDORI_VIEW (object); view = MIDORI_VIEW (object);
@ -1003,11 +1010,6 @@ midori_view_finalize (GObject* object)
katze_object_assign (view->net, NULL); 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); 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)); katze_assign (view->statusbar_text, g_value_dup_string (value));
break; break;
case PROP_SETTINGS: case PROP_SETTINGS:
midori_view_set_settings (view, g_value_get_object (value)); midori_view_set_settings (view, g_value_dup_object (value));
break; break;
case PROP_NET: case PROP_NET:
katze_object_assign (view->net, g_value_dup_object (value)); 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, webkit_web_view_console_message_cb, view,
"signal::window-object-cleared", "signal::window-object-cleared",
webkit_web_view_window_object_cleared_cb, view, webkit_web_view_window_object_cleared_cb, view,
"signal::destroy",
webkit_web_view_destroy_cb, web_frame,
NULL); NULL);
g_object_connect (web_frame, g_object_connect (web_frame,
"signal::load-done", "signal::load-done",

View file

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