[evolution-kolab] libekolabutil: added function to create a flat folder list from CamelFolderInfo



commit 493473bb5a3749e740d68118f98e2ad1061c36fd
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Thu Aug 16 17:32:09 2012 +0200

    libekolabutil: added function to create a flat folder list from CamelFolderInfo

 src/libekolabutil/kolab-util-camel.c |   22 ++++++++++++++++++++++
 src/libekolabutil/kolab-util-camel.h |    3 +++
 2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/libekolabutil/kolab-util-camel.c b/src/libekolabutil/kolab-util-camel.c
index ac7831d..2c7fd53 100644
--- a/src/libekolabutil/kolab-util-camel.c
+++ b/src/libekolabutil/kolab-util-camel.c
@@ -118,4 +118,26 @@ kolab_util_camel_imapx_folder_get_uidvalidity (CamelIMAPXFolder *folder)
 	return uidvalidity;
 }
 
+GList*
+kolab_util_camel_folderlist_from_folderinfo (CamelFolderInfo *fi)
+{
+	GList *folders_self = NULL;
+	GList *folders_chld = NULL;
+	GList *folders_next = NULL;
+	
+	if (fi == NULL)
+		return NULL;
+
+	folders_chld = kolab_util_camel_folderlist_from_folderinfo (fi->child);
+	folders_next = kolab_util_camel_folderlist_from_folderinfo (fi->next);
+
+	folders_self = g_list_append (folders_self, g_strdup (fi->full_name));
+	if (folders_chld != NULL)
+		folders_self = g_list_concat (folders_self, folders_chld);
+	if (folders_next != NULL)
+		folders_self = g_list_concat (folders_self, folders_next);
+
+	return folders_self;
+}
+
 /*----------------------------------------------------------------------------*/
diff --git a/src/libekolabutil/kolab-util-camel.h b/src/libekolabutil/kolab-util-camel.h
index 3f7af30..8e60056 100644
--- a/src/libekolabutil/kolab-util-camel.h
+++ b/src/libekolabutil/kolab-util-camel.h
@@ -74,6 +74,9 @@ kolab_util_camel_get_storage_path (CamelService *service,
 guint64
 kolab_util_camel_imapx_folder_get_uidvalidity (CamelIMAPXFolder *folder);
 
+GList*
+kolab_util_camel_folderlist_from_folderinfo (CamelFolderInfo *fi);
+
 /*----------------------------------------------------------------------------*/
 
 #endif /* _KOLAB_UTIL_CAMEL_H_ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]