From edd48d92ae634d1b32269ddb1d2b3152eb800169 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 25 Oct 2004 19:19:13 +0000 Subject: De-couple instantiation and initialisation of the extensions manager. 2004-10-25 Christian Persch * src/ephy-extensions-manager.c: (ephy_extensions_manager_init), (ephy_extensions_manager_startup): * src/ephy-extensions-manager.h: * src/ephy-shell.c: (ephy_shell_get_extensions_manager): De-couple instantiation and initialisation of the extensions manager. Fixes double-instance and weirdness and double-type-registration on startup when extensions use the session in their instance_init. --- ChangeLog | 11 +++++++++++ src/ephy-extensions-manager.c | 12 ++++++++++-- src/ephy-extensions-manager.h | 2 ++ src/ephy-shell.c | 2 ++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14bb48a91..84ce40e18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-10-25 Christian Persch + + * src/ephy-extensions-manager.c: (ephy_extensions_manager_init), + (ephy_extensions_manager_startup): + * src/ephy-extensions-manager.h: + * src/ephy-shell.c: (ephy_shell_get_extensions_manager): + + De-couple instantiation and initialisation of the extensions manager. + Fixes double-instance and weirdness and double-type-registration + on startup when extensions use the session in their instance_init. + 2004-10-25 Christian Persch * src/ephy-notebook.c: (ephy_notebook_remove_tab): diff --git a/src/ephy-extensions-manager.c b/src/ephy-extensions-manager.c index f39283abe..6139051df 100644 --- a/src/ephy-extensions-manager.c +++ b/src/ephy-extensions-manager.c @@ -887,11 +887,19 @@ init_schema_ctxt (EphyExtensionsManager *manager) static void ephy_extensions_manager_init (EphyExtensionsManager *manager) { - char *path; - manager->priv = EPHY_EXTENSIONS_MANAGER_GET_PRIVATE (manager); LOG ("EphyExtensionsManager initialising") +} + +void +ephy_extensions_manager_startup (EphyExtensionsManager *manager) +{ + char *path; + + g_return_if_fail (EPHY_IS_EXTENSIONS_MANAGER (manager)); + + LOG ("EphyExtensionsManager startup") init_schema_ctxt (manager); diff --git a/src/ephy-extensions-manager.h b/src/ephy-extensions-manager.h index d7bc81dcd..d9efb730f 100644 --- a/src/ephy-extensions-manager.h +++ b/src/ephy-extensions-manager.h @@ -70,6 +70,8 @@ struct _EphyExtensionsManager GType ephy_extensions_manager_get_type (void); +void ephy_extensions_manager_startup (EphyExtensionsManager *manager); + void ephy_extensions_manager_load (EphyExtensionsManager *manager, const char *identifier); diff --git a/src/ephy-shell.c b/src/ephy-shell.c index 9703ac719..49ff5d9a7 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -694,6 +694,8 @@ ephy_shell_get_extensions_manager (EphyShell *es) /* Instantiate extensions manager */ es->priv->extensions_manager = g_object_new (EPHY_TYPE_EXTENSIONS_MANAGER, NULL); + + ephy_extensions_manager_startup (es->priv->extensions_manager); } return G_OBJECT (es->priv->extensions_manager); -- cgit v1.2.3