diff options
author | Chris Toshok <toshok@ximian.com> | 2001-09-27 08:05:03 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2001-09-27 08:05:03 +0800 |
commit | cb20fd3b4a8d7e56f93cb0e025bf638d5cc382a8 (patch) | |
tree | 89950460e0dd40be6348261c900c38b24b738236 | |
parent | 2d7c777eac67775f95ee86499d65b2515ed22778 (diff) | |
download | gsoc2013-evolution-cb20fd3b4a8d7e56f93cb0e025bf638d5cc382a8.tar.gz gsoc2013-evolution-cb20fd3b4a8d7e56f93cb0e025bf638d5cc382a8.tar.zst gsoc2013-evolution-cb20fd3b4a8d7e56f93cb0e025bf638d5cc382a8.zip |
use priv->iid instead of the hardcoded string here.
2001-09-26 Chris Toshok <toshok@ximian.com>
* backend/pas/pas-book-factory.c (pas_book_factory_destroy): use
priv->iid instead of the hardcoded string here.
(pas_book_factory_activate): parameterize the factory's iid, as in
the calendar server, and provide a default if iid == NULL.
* backend/pas/pas-book-factory.h: add iid parameter for
pas_book_factory_activate.
svn path=/trunk/; revision=13180
-rw-r--r-- | addressbook/ChangeLog | 10 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-book-factory.c | 30 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-book-factory.h | 2 |
3 files changed, 33 insertions, 9 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index b7695085c9..853d90d1c9 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,13 @@ +2001-09-26 Chris Toshok <toshok@ximian.com> + + * backend/pas/pas-book-factory.c (pas_book_factory_destroy): use + priv->iid instead of the hardcoded string here. + (pas_book_factory_activate): parameterize the factory's iid, as in + the calendar server, and provide a default if iid == NULL. + + * backend/pas/pas-book-factory.h: add iid parameter for + pas_book_factory_activate. + 2001-09-26 Jon Trowbridge <trow@ximian.com> * backend/ebook/e-destination.c (e_destination_get_textrep): Use diff --git a/addressbook/backend/pas/pas-book-factory.c b/addressbook/backend/pas/pas-book-factory.c index ca4c74631f..cb7b291a9e 100644 --- a/addressbook/backend/pas/pas-book-factory.c +++ b/addressbook/backend/pas/pas-book-factory.c @@ -15,7 +15,7 @@ #include "addressbook.h" #include "pas-book-factory.h" -#define PAS_BOOK_FACTORY_OAF_ID "OAFIID:GNOME_Evolution_Wombat_ServerFactory" +#define DEFAULT_PAS_BOOK_FACTORY_OAF_ID "OAFIID:GNOME_Evolution_Wombat_ServerFactory" static BonoboObjectClass *pas_book_factory_parent_class; POA_GNOME_Evolution_Addressbook_BookFactory__vepv pas_book_factory_vepv; @@ -31,6 +31,9 @@ struct _PASBookFactoryPrivate { GHashTable *active_server_map; GList *queued_requests; + /* OAFIID of the factory */ + char *iid; + /* Whether the factory has been registered with OAF yet */ guint registered : 1; }; @@ -426,11 +429,12 @@ pas_book_factory_new (void) * pas_book_factory_activate: */ gboolean -pas_book_factory_activate (PASBookFactory *factory) +pas_book_factory_activate (PASBookFactory *factory, const char *iid) { PASBookFactoryPrivate *priv; CORBA_Object obj; OAF_RegistrationResult result; + char *tmp_iid; g_return_val_if_fail (factory != NULL, FALSE); g_return_val_if_fail (PAS_IS_BOOK_FACTORY (factory), FALSE); @@ -439,27 +443,35 @@ pas_book_factory_activate (PASBookFactory *factory) g_return_val_if_fail (!priv->registered, FALSE); - puts ("about to register addressbook"); + /* if iid is NULL, use the default factory OAFIID */ + if (iid) + tmp_iid = g_strdup (iid); + else + tmp_iid = g_strdup (DEFAULT_PAS_BOOK_FACTORY_OAF_ID); obj = bonobo_object_corba_objref (BONOBO_OBJECT (factory)); - result = oaf_active_server_register (PAS_BOOK_FACTORY_OAF_ID, obj); + result = oaf_active_server_register (tmp_iid, obj); switch (result) { case OAF_REG_SUCCESS: priv->registered = TRUE; + priv->iid = tmp_iid; return TRUE; case OAF_REG_NOT_LISTED: g_message ("Error registering the PAS factory: not listed"); - return FALSE; + break; case OAF_REG_ALREADY_ACTIVE: g_message ("Error registering the PAS factory: already active"); - return FALSE; + break; case OAF_REG_ERROR: default: g_message ("Error registering the PAS factory: generic error"); - return FALSE; + break; } + + g_free (tmp_iid); + return FALSE; } static void @@ -532,9 +544,11 @@ pas_book_factory_destroy (GtkObject *object) CORBA_Object obj; obj = bonobo_object_corba_objref (BONOBO_OBJECT (factory)); - oaf_active_server_unregister (PAS_BOOK_FACTORY_OAF_ID, obj); + oaf_active_server_unregister (factory->priv->iid, obj); factory->priv->registered = FALSE; } + + g_free (factory->priv->iid); g_free (factory->priv); diff --git a/addressbook/backend/pas/pas-book-factory.h b/addressbook/backend/pas/pas-book-factory.h index fc00b7b423..22d4a87b3e 100644 --- a/addressbook/backend/pas/pas-book-factory.h +++ b/addressbook/backend/pas/pas-book-factory.h @@ -35,7 +35,7 @@ void pas_book_factory_register_backend (PASBookFactory int pas_book_factory_get_n_backends (PASBookFactory *factory); -gboolean pas_book_factory_activate (PASBookFactory *factory); +gboolean pas_book_factory_activate (PASBookFactory *factory, const char *iid); GtkType pas_book_factory_get_type (void); |