aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-corba-storage-registry.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2002-05-08 03:53:35 +0800
committerJP Rosevear <jpr@src.gnome.org>2002-05-08 03:53:35 +0800
commit2017b2dcec910cc90d771fc2c124828e3c122014 (patch)
tree706437db1e84687c02cdaeee10d4693c3b8ee193 /shell/e-corba-storage-registry.c
parent03e2a84eda5327f01e768e74caa81247faf7a157 (diff)
downloadgsoc2013-evolution-2017b2dcec910cc90d771fc2c124828e3c122014.tar.gz
gsoc2013-evolution-2017b2dcec910cc90d771fc2c124828e3c122014.tar.zst
gsoc2013-evolution-2017b2dcec910cc90d771fc2c124828e3c122014.zip
add every folder to the sequence except the root folder
2002-05-07 JP Rosevear <jpr@ximian.com> * evolution-storage.c (get_folder_list_foreach): add every folder to the sequence except the root folder (impl_Storage_get_folder_list): implement corba method (evolution_storage_get_epv): set new method implementation * evolution-folder-selector-button.h: fix signal prototype * e-folder-tree.h: new proto * e-folder-tree.c (e_folder_tree_get_count): count nodes (count_nodes): bump count foreach path * e-corba-storage-registry.c (impl_StorageRegistry_getStorageList): implement idl method (corba_class_init): set epv method * Evolution-Storage.idl: add getStorageList and getFolderList methods svn path=/trunk/; revision=16708
Diffstat (limited to 'shell/e-corba-storage-registry.c')
-rw-r--r--shell/e-corba-storage-registry.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/shell/e-corba-storage-registry.c b/shell/e-corba-storage-registry.c
index 72ddf075a8..36f2a89ce5 100644
--- a/shell/e-corba-storage-registry.c
+++ b/shell/e-corba-storage-registry.c
@@ -24,6 +24,7 @@
#include <config.h>
#endif
+#include "e-local-storage.h"
#include "e-corba-storage.h"
#include "e-corba-storage-registry.h"
#include "e-shell-constants.h"
@@ -130,6 +131,54 @@ impl_StorageRegistry_addStorage (PortableServer_Servant servant,
return listener_interface;
}
+static GNOME_Evolution_StorageRegistry_StorageList *
+impl_StorageRegistry_getStorageList (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ BonoboObject *bonobo_object;
+ ECorbaStorageRegistry *storage_registry;
+ ECorbaStorageRegistryPrivate *priv;
+ GNOME_Evolution_StorageRegistry_StorageList *storage_list;
+ GList *sl, *l;
+
+ bonobo_object = bonobo_object_from_servant (servant);
+ storage_registry = E_CORBA_STORAGE_REGISTRY (bonobo_object);
+ priv = storage_registry->priv;
+
+ sl = e_storage_set_get_storage_list (priv->storage_set);
+
+ storage_list = GNOME_Evolution_StorageRegistry_StorageList__alloc ();
+ storage_list->_maximum = g_list_length (sl);
+ storage_list->_length = 0;
+ storage_list->_buffer = CORBA_sequence_GNOME_Evolution_Storage_allocbuf (storage_list->_maximum);
+ for (l = sl; l != NULL; l = l->next) {
+ EStorage *storage;
+ GNOME_Evolution_Storage corba_storage;
+ CORBA_Environment ev2;
+
+ CORBA_exception_init (&ev2);
+
+ storage = l->data;
+ if (E_IS_LOCAL_STORAGE (storage)) {
+ corba_storage = e_local_storage_get_corba_interface (E_LOCAL_STORAGE (storage));
+ } else if (E_IS_CORBA_STORAGE (storage)) {
+ corba_storage = e_corba_storage_get_corba_objref (E_CORBA_STORAGE (storage));
+ } else {
+ continue;
+ }
+
+ corba_storage = CORBA_Object_duplicate (corba_storage, &ev2);
+ if (BONOBO_EX (&ev2)) {
+ CORBA_exception_free (&ev2);
+ continue;
+ }
+ storage_list->_buffer[storage_list->_length] = corba_storage;
+ storage_list->_length++;
+ }
+
+ return storage_list;
+}
+
static GNOME_Evolution_Storage
impl_StorageRegistry_getStorageByName (PortableServer_Servant servant,
const CORBA_char *name,
@@ -384,6 +433,7 @@ corba_class_init (void)
epv = g_new0 (POA_GNOME_Evolution_StorageRegistry__epv, 1);
epv->addStorage = impl_StorageRegistry_addStorage;
+ epv->getStorageList = impl_StorageRegistry_getStorageList;
epv->getStorageByName = impl_StorageRegistry_getStorageByName;
epv->removeStorageByName = impl_StorageRegistry_removeStorageByName;
epv->addListener = impl_StorageRegistry_addListener;