diff options
-rw-r--r-- | mail/ChangeLog | 16 | ||||
-rw-r--r-- | mail/GNOME_Evolution_Mail.oaf.in | 15 | ||||
-rw-r--r-- | 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 <ettore@ximian.com> + + [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 <rodo@ximian.com> * 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,24 +25,11 @@ _value="Evolution mail folder display component."/> </oaf_server> -<oaf_server iid="OAFIID:GNOME_Evolution_Mail_ShellComponentFactory" +<oaf_server iid="OAFIID:GNOME_Evolution_Mail_ShellComponent" type="exe" location="evolution-mail"> <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/ObjectFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - _value="Factory for the Evolution mail component."/> - -</oaf_server> - -<oaf_server iid="OAFIID:GNOME_Evolution_Mail_ShellComponent" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_ShellComponentFactory"> - - <oaf_attribute name="repo_ids" type="stringv"> <item value="IDL:GNOME/Evolution/ShellComponent:1.0"/> </oaf_attribute> 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 |