From 86de708aac4233bc681d6d15188da7b0312e4a3f Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 5 Sep 2001 22:46:53 +0000 Subject: [Fix #958, ShellComponents should not be created by factories, for the mailer case.] * GNOME_Evolution_Mail.oaf.in: Remove the GNOME_Evolution_Mail_ShellComponentFactory. * component-factory.c: Changed to not use a factory. (COMPONENT_FACTORY_ID): Removed. (COMPONENT_ID): New. (idle_quit): Don't unref the component_factory. (create_component): Renamed from `component_fn'. Take no args. (component_factory_init): Create the component with `create_component' and register it on OAF. svn path=/trunk/; revision=12637 --- mail/ChangeLog | 16 ++++++++++++++++ mail/GNOME_Evolution_Mail.oaf.in | 15 +-------------- mail/component-factory.c | 24 +++++++++++++----------- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 523ff74dac..2db02bc893 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,19 @@ +2001-09-05 Ettore Perazzoli + + [Fix #958, ShellComponents should not be created by factories, for + the mailer case.] + + * GNOME_Evolution_Mail.oaf.in: Remove the + GNOME_Evolution_Mail_ShellComponentFactory. + + * component-factory.c: Changed to not use a factory. + (COMPONENT_FACTORY_ID): Removed. + (COMPONENT_ID): New. + (idle_quit): Don't unref the component_factory. + (create_component): Renamed from `component_fn'. Take no args. + (component_factory_init): Create the component with + `create_component' and register it on OAF. + 2001-09-06 Radek Doulik * everywhere updated for new mail_content_loaded definition diff --git a/mail/GNOME_Evolution_Mail.oaf.in b/mail/GNOME_Evolution_Mail.oaf.in index 306a976f53..b693e8863d 100644 --- a/mail/GNOME_Evolution_Mail.oaf.in +++ b/mail/GNOME_Evolution_Mail.oaf.in @@ -25,23 +25,10 @@ _value="Evolution mail folder display component."/> - - - - - - - - - - - diff --git a/mail/component-factory.c b/mail/component-factory.c index 44b5aa6895..a66200f5b5 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -63,10 +63,9 @@ char *evolution_dir; EvolutionShellClient *global_shell_client = NULL; -#define COMPONENT_FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ShellComponentFactory" -#define SUMMARY_FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ExecutiveSummaryComponentFactory" +#define COMPONENT_ID "OAFIID:GNOME_Evolution_Mail_ShellComponent" +#define SUMMARY_FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ExecutiveSummaryComponentFactory" -static BonoboGenericFactory *component_factory = NULL; static GHashTable *storages_hash; static EvolutionShellComponent *shell_component; @@ -677,7 +676,6 @@ idle_quit (gpointer user_data) if (e_list_length (folder_browser_factory_get_control_list ())) return TRUE; - bonobo_object_unref (BONOBO_OBJECT (component_factory)); g_hash_table_foreach (storages_hash, free_storage, NULL); g_hash_table_destroy (storages_hash); @@ -742,7 +740,7 @@ user_create_new_item_cb (EvolutionShellComponent *shell_component, } static BonoboObject * -component_fn (BonoboGenericFactory *factory, void *closure) +create_component (void) { EvolutionShellComponentDndDestinationFolder *destination_interface; MailOfflineHandler *offline_handler; @@ -790,17 +788,21 @@ component_fn (BonoboGenericFactory *factory, void *closure) void component_factory_init (void) { - component_factory = bonobo_generic_factory_new (COMPONENT_FACTORY_ID, - component_fn, NULL); + BonoboObject *shell_component; + int result; - evolution_mail_config_factory_init (); - evolution_folder_info_factory_init (); - - if (component_factory == NULL) { + shell_component = create_component (); + result = oaf_active_server_register (COMPONENT_ID, bonobo_object_corba_objref (shell_component)); + if (result == OAF_REG_ERROR) { e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, _("Cannot initialize Evolution's mail component.")); exit (1); } + + /* FIXME these don't check for errors. */ + + evolution_mail_config_factory_init (); + evolution_folder_info_factory_init (); } static int -- cgit v1.2.3