aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-09-06 07:10:07 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-09-06 07:10:07 +0800
commitd6dd04933149ca13536cdaf2b32ca79387e93bdb (patch)
tree356e65b2b6c922a72a6667908b1d3fcdbc66a7bb
parent56e5135e5ad332d906642c5bd923bf2fbd6d5296 (diff)
downloadgsoc2013-evolution-d6dd04933149ca13536cdaf2b32ca79387e93bdb.tar.gz
gsoc2013-evolution-d6dd04933149ca13536cdaf2b32ca79387e93bdb.tar.zst
gsoc2013-evolution-d6dd04933149ca13536cdaf2b32ca79387e93bdb.zip
[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
-rw-r--r--addressbook/ChangeLog15
-rw-r--r--addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in15
-rw-r--r--addressbook/gui/component/addressbook-component.c21
3 files changed, 28 insertions, 23 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 8947dd94d4..0721244a1c 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,18 @@
+2001-09-05 Ettore Perazzoli <ettore@ximian.com>
+
+ [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.
+
2001-09-04 Iain Holmes <iain@ximian.com>
* backend/ebook/evolution-vcard-importer.c (load_file_fn): Return FALSE
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,24 +61,11 @@
</oaf_server>
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_ShellComponentFactory"
+<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_ShellComponent"
type="exe"
location="evolution-addressbook">
<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 addressbook component."/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_ShellComponent"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_ShellComponentFactory">
-
- <oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Evolution/ShellComponent:1.0"/>
</oaf_attribute>
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);
+}