diff options
-rw-r--r-- | calendar/ChangeLog | 6 | ||||
-rw-r--r-- | calendar/pcs/cal-factory.c | 25 | ||||
-rw-r--r-- | calendar/pcs/cal-factory.h | 2 |
3 files changed, 27 insertions, 6 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 3c725c89da..5ff1568ec3 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,9 @@ +2001-09-19 Rodrigo Moya <rodrigo@ximian.com> + + * pcs/cal-factory.c (cal_factory_oaf_register): add a new parameter + (const char *iid) to specify the OAFIID of the factory being + registered + 2001-09-19 JP Rosevear <jpr@ximian.com> * gui/e-meeting-model.c (e_meeting_model_refresh_busy_periods): diff --git a/calendar/pcs/cal-factory.c b/calendar/pcs/cal-factory.c index 86090fc2bb..00f6d8b6da 100644 --- a/calendar/pcs/cal-factory.c +++ b/calendar/pcs/cal-factory.c @@ -30,8 +30,8 @@ #include "cal-factory.h" #include "job.h" -#define PARENT_TYPE BONOBO_X_OBJECT_TYPE -#define CAL_FACTORY_OAF_ID "OAFIID:GNOME_Evolution_Wombat_CalendarFactory" +#define PARENT_TYPE BONOBO_X_OBJECT_TYPE +#define DEFAULT_CAL_FACTORY_OAF_ID "OAFIID:GNOME_Evolution_Wombat_CalendarFactory" static BonoboXObjectClass *parent_class; @@ -43,6 +43,9 @@ struct _CalFactoryPrivate { /* Hash table from GnomeVFSURI structures to CalBackend objects */ GHashTable *backends; + /* OAFIID of the factory */ + char *iid; + /* Whether we have been registered with OAF yet */ guint registered : 1; }; @@ -469,9 +472,10 @@ cal_factory_destroy (GtkObject *object) priv->backends = NULL; if (priv->registered) { - oaf_active_server_unregister (CAL_FACTORY_OAF_ID, BONOBO_OBJREF (factory)); + oaf_active_server_unregister (priv->iid, BONOBO_OBJREF (factory)); priv->registered = FALSE; } + g_free (priv->iid); g_free (priv); factory->priv = NULL; @@ -543,6 +547,7 @@ str_tolower (const char *s) /** * cal_factory_oaf_register: * @factory: A calendar factory. + * @iid: OAFIID for the factory to be registered. * * Registers a calendar factory with the OAF object activation daemon. This * function must be called before any clients can activate the factory. @@ -550,10 +555,11 @@ str_tolower (const char *s) * Return value: TRUE on success, FALSE otherwise. **/ gboolean -cal_factory_oaf_register (CalFactory *factory) +cal_factory_oaf_register (CalFactory *factory, const char *iid) { CalFactoryPrivate *priv; OAF_RegistrationResult result; + char *tmp_iid; g_return_val_if_fail (factory != NULL, FALSE); g_return_val_if_fail (IS_CAL_FACTORY (factory), FALSE); @@ -562,11 +568,18 @@ cal_factory_oaf_register (CalFactory *factory) g_return_val_if_fail (!priv->registered, FALSE); - result = oaf_active_server_register (CAL_FACTORY_OAF_ID, BONOBO_OBJREF (factory)); + /* if iid is NULL, use the default factory OAFIID */ + if (iid) + tmp_iid = g_strdup (iid); + else + tmp_iid = g_strdup (DEFAULT_CAL_FACTORY_OAF_ID); + + result = oaf_active_server_register (tmp_iid, BONOBO_OBJREF (factory)); switch (result) { case OAF_REG_SUCCESS: priv->registered = TRUE; + priv->iid = tmp_iid; return TRUE; case OAF_REG_NOT_LISTED: @@ -586,6 +599,8 @@ cal_factory_oaf_register (CalFactory *factory) break; } + g_free (tmp_iid); + return FALSE; } diff --git a/calendar/pcs/cal-factory.h b/calendar/pcs/cal-factory.h index 008fc2c36d..434cb56f81 100644 --- a/calendar/pcs/cal-factory.h +++ b/calendar/pcs/cal-factory.h @@ -62,7 +62,7 @@ struct _CalFactoryClass { GtkType cal_factory_get_type (void); CalFactory *cal_factory_new (void); -gboolean cal_factory_oaf_register (CalFactory *factory); +gboolean cal_factory_oaf_register (CalFactory *factory, const char *iid); void cal_factory_register_method (CalFactory *factory, const char *method, GtkType backend_type); |