From 2017b2dcec910cc90d771fc2c124828e3c122014 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Tue, 7 May 2002 19:53:35 +0000 Subject: add every folder to the sequence except the root folder 2002-05-07 JP Rosevear * 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 --- shell/e-folder-tree.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'shell/e-folder-tree.c') 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 -- cgit v1.2.3