From a59768d50d370db68ff9ed789b5077e68aecf6f6 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Wed, 15 May 2002 13:34:31 +0000 Subject: Committing Peter Williams patch so listeners are notified about new storages. svn path=/trunk/; revision=16800 --- shell/ChangeLog | 6 ++++++ shell/e-corba-storage-registry.c | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index db0b341117..39da515c97 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,9 @@ +2002-05-15 Iain + + * e-corba-storage-registry.c (impl_StorageRegistry_addStorage): Apply + patch from Peter Williams to notify listeners when a new storage is + created. + 2002-05-14 Ettore Perazzoli * e-shell-offline-handler.c diff --git a/shell/e-corba-storage-registry.c b/shell/e-corba-storage-registry.c index 36f2a89ce5..5ac8260862 100644 --- a/shell/e-corba-storage-registry.c +++ b/shell/e-corba-storage-registry.c @@ -108,7 +108,8 @@ impl_StorageRegistry_addStorage (PortableServer_Servant servant, ECorbaStorageRegistryPrivate *priv; EStorage *storage; GNOME_Evolution_StorageListener listener_interface; - + GSList *iter; + bonobo_object = bonobo_object_from_servant (servant); storage_registry = E_CORBA_STORAGE_REGISTRY (bonobo_object); priv = storage_registry->priv; @@ -125,6 +126,16 @@ impl_StorageRegistry_addStorage (PortableServer_Servant servant, gtk_object_unref (GTK_OBJECT (storage)); + + /* FIXME: if we remove a listener while looping through the list we can + * crash. Yay CORBA reentrancy. */ + g_print ("Added name: %s\n", name); + for (iter = priv->listeners; iter; iter = iter->next) { + listener_notify (iter->data, + GNOME_Evolution_StorageRegistry_STORAGE_CREATED, + name); + } + listener_interface = CORBA_Object_duplicate (e_corba_storage_get_StorageListener (E_CORBA_STORAGE (storage)), ev); -- cgit