From ab747a427fc3390c1030875c151b6f0750d2175d Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 20 Nov 2008 01:49:04 +0100 Subject: [PATCH] Let MidoriApp be a normal instance There is hardly a practical need for the application to be a singleton, it's cleaner and it prevents extensions from reaching out for it before activation. --- midori/midori-app.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/midori/midori-app.c b/midori/midori-app.c index 5e754e1e..2b875b1a 100644 --- a/midori/midori-app.c +++ b/midori/midori-app.c @@ -43,8 +43,6 @@ struct _MidoriApp G_DEFINE_TYPE (MidoriApp, midori_app, G_TYPE_OBJECT) -static MidoriApp* _midori_app_singleton = NULL; - enum { PROP_0, @@ -68,11 +66,6 @@ enum { static guint signals[LAST_SIGNAL]; -static GObject* -midori_app_constructor (GType type, - guint n_construct_properties, - GObjectConstructParam* construct_properties); - static void midori_app_finalize (GObject* object); @@ -193,7 +186,6 @@ midori_app_class_init (MidoriAppClass* class) G_TYPE_NONE, 0); gobject_class = G_OBJECT_CLASS (class); - gobject_class->constructor = midori_app_constructor; gobject_class->finalize = midori_app_finalize; gobject_class->set_property = midori_app_set_property; gobject_class->get_property = midori_app_get_property; @@ -274,18 +266,6 @@ midori_app_class_init (MidoriAppClass* class) G_PARAM_READABLE)); } -static GObject* -midori_app_constructor (GType type, - guint n_construct_properties, - GObjectConstructParam* construct_properties) -{ - if (_midori_app_singleton) - return g_object_ref (_midori_app_singleton); - else - return G_OBJECT_CLASS (midori_app_parent_class)->constructor ( - type, n_construct_properties, construct_properties); -} - #if HAVE_UNIQUE static UniqueResponse midori_browser_message_received_cb (UniqueApp* instance, @@ -387,10 +367,6 @@ midori_app_init (MidoriApp* app) guint i, n; #endif - g_assert (!_midori_app_singleton); - - _midori_app_singleton = app; - app->accel_group = gtk_accel_group_new (); app->settings = midori_web_settings_new (); -- 2.39.5