aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-folder-tree.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-folder-tree.c
parent03e2a84eda5327f01e768e74caa81247faf7a157 (diff)
downloadgsoc2013-evolution-2017b2dcec910cc90d771fc2c124828e3c122014.tar
gsoc2013-evolution-2017b2dcec910cc90d771fc2c124828e3c122014.tar.gz
gsoc2013-evolution-2017b2dcec910cc90d771fc2c124828e3c122014.tar.bz2
gsoc2013-evolution-2017b2dcec910cc90d771fc2c124828e3c122014.tar.lz
gsoc2013-evolution-2017b2dcec910cc90d771fc2c124828e3c122014.tar.xz
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-folder-tree.c')
-rw-r--r--shell/e-folder-tree.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/shell/e-folder-tree.c b/shell/e-folder-tree.c
index d89476df2e..46e7897711 100644
--- a/shell/e-folder-tree.c
+++ b/shell/e-folder-tree.c
@@ -315,6 +315,35 @@ e_folder_tree_remove (EFolderTree *folder_tree,
return TRUE;
}
+static void
+count_nodes (EFolderTree *tree,
+ const char *path,
+ void *data,
+ void *closure)
+{
+ int *count = closure;
+
+ (*count)++;
+}
+
+/**
+ * e_folder_tree_get_count:
+ * @folder_tree: A pointer to an EFolderTree
+ *
+ * Gets the number of folders in the tree
+ *
+ * Return value: The number of folders in the tree
+ **/
+int
+e_folder_tree_get_count (EFolderTree *folder_tree)
+{
+ int count = 0;
+
+ e_folder_tree_foreach (folder_tree, count_nodes, &count);
+
+ return count;
+}
+
/**
* e_folder_tree_get_folder:
* @folder_tree: A pointer to an EFolderTree