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/e-corba-storage-registry.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'shell/e-corba-storage-registry.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 v1.2.3