From d6dd04933149ca13536cdaf2b32ca79387e93bdb Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 5 Sep 2001 23:10:07 +0000 Subject: [Fix #958, ShellComponents should not be created by factories, for the addressbook.] * gui/component/addressbook-component.c (GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_FACTORY_ID): Removed. (GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_ID): New. (create_component): Renamed from `factory_fn'. Just register the thing on OAF. (addressbook_component_factory_init): Just call it. * gui/component/GNOME_Evolution_Addressbook.oaf.in: Remove the ShellComponentFactory. svn path=/trunk/; revision=12642 --- .../component/GNOME_Evolution_Addressbook.oaf.in | 15 +-------------- addressbook/gui/component/addressbook-component.c | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 23 deletions(-) (limited to 'addressbook/gui/component') diff --git a/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in b/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in index 7350b4925e..b050e8ebb8 100644 --- a/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in +++ b/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in @@ -61,23 +61,10 @@ - - - - - - - - - - - diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index 17712134b3..961f706620 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -47,7 +47,7 @@ -#define GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_ShellComponentFactory" +#define GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_ID "OAFIID:GNOME_Evolution_Addressbook_ShellComponent" EvolutionShellClient *global_shell_client; @@ -363,8 +363,7 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *fol /* The factory function. */ static BonoboObject * -factory_fn (BonoboGenericFactory *factory, - void *closure) +create_component (void) { EvolutionShellComponent *shell_component; EvolutionShellComponentDndDestinationFolder *destination_interface; @@ -397,15 +396,19 @@ factory_fn (BonoboGenericFactory *factory, } +/* FIXME this should probably be renamed as we don't use factories anymore. */ void addressbook_component_factory_init (void) { - if (factory != NULL) - return; + BonoboObject *object; + int result; - factory = bonobo_generic_factory_new (GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_FACTORY_ID, factory_fn, NULL); + object = create_component (); - if (factory == NULL) - g_error ("Cannot initialize the Evolution addressbook factory."); -} + /* FIXME: Handle errors better? */ + result = oaf_active_server_register (GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_ID, + bonobo_object_corba_objref (object)); + if (result == OAF_REG_ERROR) + g_error ("Cannot register -- %s", GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_ID); +} -- cgit v1.2.3