aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog15
-rw-r--r--calendar/gui/GNOME_Evolution_Calendar.oaf.in15
-rw-r--r--calendar/gui/calendar-component.c23
-rw-r--r--calendar/gui/component-factory.c23
4 files changed, 38 insertions, 38 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 881d010183..fdf6a2d2ef 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,18 @@
+2001-09-05 Ettore Perazzoli <ettore@ximian.com>
+
+ [Fix #958, ShellComponents should not be created by factories, for
+ the calendar.]
+
+ * gui/GNOME_Evolution_Calendar.oaf.in: Remove the
+ ShellComponentFactory.
+
+ * gui/component-factory.c (create_object): Renamed from
+ `component_fn'. Don't get any args.
+ (component_factory_init): Create the component using
+ `create_object()' and register it into OAF.
+ (COMPONENT_FACTORY_ID): Removed.
+ (COMPONENT_ID): New.
+
2001-09-04 Federico Mena Quintero <federico@ximian.com>
* gui/component-factory.c (sc_user_create_new_item_cb):
diff --git a/calendar/gui/GNOME_Evolution_Calendar.oaf.in b/calendar/gui/GNOME_Evolution_Calendar.oaf.in
index 4d80cfa0de..640a28d6a1 100644
--- a/calendar/gui/GNOME_Evolution_Calendar.oaf.in
+++ b/calendar/gui/GNOME_Evolution_Calendar.oaf.in
@@ -34,24 +34,11 @@
</oaf_server>
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_ShellComponentFactory"
+<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_ShellComponent"
type="exe"
location="evolution-calendar">
<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 calendar component."/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Calendar_ShellComponent"
- type="factory"
- location="OAFIID:GNOME_Evolution_Calendar_ShellComponentFactory">
-
- <oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Evolution/ShellComponent:1.0"/>
</oaf_attribute>
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index 10d53a54ea..5954cf88d9 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -41,9 +41,9 @@
-/* OAFIID for the component factory */
-#define COMPONENT_FACTORY_ID "OAFIID:GNOME_Evolution_Calendar_ShellComponentFactory"
-
+/* OAFIID for the component. */
+#define COMPONENT_ID "OAFIID:GNOME_Evolution_Calendar_ShellComponent"
+
/* Folder type IDs */
#define FOLDER_CALENDAR "calendar"
#define FOLDER_TASKS "tasks"
@@ -479,8 +479,7 @@ destroy_cb (EvolutionShellComponent *shell_component,
/* The factory function. */
static BonoboObject *
-factory_fn (BonoboGenericFactory *factory,
- void *closure)
+create_object (void)
{
EvolutionShellComponent *shell_component;
@@ -498,6 +497,7 @@ factory_fn (BonoboGenericFactory *factory,
GTK_SIGNAL_FUNC (owner_set_cb), NULL);
gtk_signal_connect (GTK_OBJECT (shell_component), "owner_unset",
GTK_SIGNAL_FUNC (owner_unset_cb), NULL);
+
#if 0
gtk_signal_connect (GTK_OBJECT (shell_component), "destroy",
GTK_SIGNAL_FUNC (destroy_cb), NULL);
@@ -526,17 +526,16 @@ factory_fn (BonoboGenericFactory *factory,
}
-
void
component_factory_init (void)
{
- if (factory != NULL)
- return;
+ BonoboObject *object;
+ int result;
- factory = bonobo_generic_factory_new (COMPONENT_FACTORY_ID, factory_fn, NULL);
- bonobo_running_context_auto_exit_unref (BONOBO_OBJECT (factory));
+ object = create_object ();
- if (factory == NULL)
- g_error ("Cannot initialize Evolution's calendar component.");
+ result = oaf_active_server_register (COMPONENT_ID, bonobo_object_corba_objref (object));
+ if (result == OAF_REG_ERROR)
+ g_error ("Cannot initialize Evolution's calendar component.");
}
diff --git a/calendar/gui/component-factory.c b/calendar/gui/component-factory.c
index 10d53a54ea..5954cf88d9 100644
--- a/calendar/gui/component-factory.c
+++ b/calendar/gui/component-factory.c
@@ -41,9 +41,9 @@
-/* OAFIID for the component factory */
-#define COMPONENT_FACTORY_ID "OAFIID:GNOME_Evolution_Calendar_ShellComponentFactory"
-
+/* OAFIID for the component. */
+#define COMPONENT_ID "OAFIID:GNOME_Evolution_Calendar_ShellComponent"
+
/* Folder type IDs */
#define FOLDER_CALENDAR "calendar"
#define FOLDER_TASKS "tasks"
@@ -479,8 +479,7 @@ destroy_cb (EvolutionShellComponent *shell_component,
/* The factory function. */
static BonoboObject *
-factory_fn (BonoboGenericFactory *factory,
- void *closure)
+create_object (void)
{
EvolutionShellComponent *shell_component;
@@ -498,6 +497,7 @@ factory_fn (BonoboGenericFactory *factory,
GTK_SIGNAL_FUNC (owner_set_cb), NULL);
gtk_signal_connect (GTK_OBJECT (shell_component), "owner_unset",
GTK_SIGNAL_FUNC (owner_unset_cb), NULL);
+
#if 0
gtk_signal_connect (GTK_OBJECT (shell_component), "destroy",
GTK_SIGNAL_FUNC (destroy_cb), NULL);
@@ -526,17 +526,16 @@ factory_fn (BonoboGenericFactory *factory,
}
-
void
component_factory_init (void)
{
- if (factory != NULL)
- return;
+ BonoboObject *object;
+ int result;
- factory = bonobo_generic_factory_new (COMPONENT_FACTORY_ID, factory_fn, NULL);
- bonobo_running_context_auto_exit_unref (BONOBO_OBJECT (factory));
+ object = create_object ();
- if (factory == NULL)
- g_error ("Cannot initialize Evolution's calendar component.");
+ result = oaf_active_server_register (COMPONENT_ID, bonobo_object_corba_objref (object));
+ if (result == OAF_REG_ERROR)
+ g_error ("Cannot initialize Evolution's calendar component.");
}