[evolution-kolab] CamelKolabIMAPXStore: exposed folder type setter



commit 833c3f00c9c331d13f66474fc908f3ac73ecd7c3
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Mon Oct 15 19:06:47 2012 +0200

    CamelKolabIMAPXStore: exposed folder type setter
    
    * exposed the function for setting the Kolab folder
      type (annotation) on an IMAP folder in the API

 src/libekolab/camel-kolab-imapx-store.c |   48 +++++++++++++++++++++++++++++++
 src/libekolab/camel-kolab-imapx-store.h |   14 +++++++++
 2 files changed, 62 insertions(+), 0 deletions(-)
---
diff --git a/src/libekolab/camel-kolab-imapx-store.c b/src/libekolab/camel-kolab-imapx-store.c
index ed3a1c0..145b4b7 100644
--- a/src/libekolab/camel-kolab-imapx-store.c
+++ b/src/libekolab/camel-kolab-imapx-store.c
@@ -1136,6 +1136,32 @@ kolab_imapx_store_get_folder_type (CamelKolabIMAPXStore *self,
 	return folder_type;
 }
 
+static gboolean
+kolab_imapx_store_set_folder_type (CamelKolabIMAPXStore *self,
+                                   const gchar *foldername,
+                                   KolabFolderTypeID foldertype,
+                                   GCancellable *cancellable,
+                                   GError **err)
+{
+	GError *tmp_err = NULL;
+	gboolean ok = FALSE;
+
+	g_assert (CAMEL_IS_KOLAB_IMAPX_STORE (self));
+	g_assert (foldername != NULL);
+	/* cancellable may be NULL */
+	g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
+
+	ok = imapx_store_set_foldertype (self,
+	                                 foldername,
+	                                 foldertype,
+	                                 cancellable,
+	                                 &tmp_err);
+	if (! ok)
+		g_propagate_error (err, tmp_err);
+
+	return ok;
+}
+
 static GList*
 kolab_imapx_store_resect_folder_list (CamelKolabIMAPXStore *self)
 {
@@ -1538,6 +1564,7 @@ camel_kolab_imapx_store_class_init (CamelKolabIMAPXStoreClass *klass)
 	klass->get_folder_creation_type = kolab_imapx_store_get_folder_creation_type;
 	klass->set_folder_context = kolab_imapx_store_set_folder_context;
 	klass->get_folder_type = kolab_imapx_store_get_folder_type;
+	klass->set_folder_type = kolab_imapx_store_set_folder_type;
 	klass->get_folder_info_online = kolab_imapx_store_get_folder_info_online;
 	klass->resect_folder_list = kolab_imapx_store_resect_folder_list;
 	klass->get_show_all_folders = kolab_imapx_store_get_show_all_folders;
@@ -1615,6 +1642,27 @@ camel_kolab_imapx_store_get_folder_type (CamelKolabIMAPXStore *self,
 	return foldertype;
 }
 
+gboolean
+camel_kolab_imapx_store_set_folder_type (CamelKolabIMAPXStore *self,
+                                         const gchar *foldername,
+                                         KolabFolderTypeID foldertype,
+                                         GCancellable *cancellable,
+                                         GError **err)
+{
+	CamelKolabIMAPXStoreClass *klass = NULL;
+	gboolean ok = FALSE;
+
+	g_return_val_if_fail (CAMEL_IS_KOLAB_IMAPX_STORE (self), KOLAB_FOLDER_TYPE_INVAL);
+
+	klass = CAMEL_KOLAB_IMAPX_STORE_GET_CLASS (self);
+	ok = klass->set_folder_type (self,
+	                             foldername,
+	                             foldertype,
+	                             cancellable,
+	                             err);
+	return ok;
+}
+
 CamelFolderInfo*
 camel_kolab_imapx_store_get_folder_info_online (CamelKolabIMAPXStore *self,
                                                 const gchar *top,
diff --git a/src/libekolab/camel-kolab-imapx-store.h b/src/libekolab/camel-kolab-imapx-store.h
index e5fb690..4631dc3 100644
--- a/src/libekolab/camel-kolab-imapx-store.h
+++ b/src/libekolab/camel-kolab-imapx-store.h
@@ -89,6 +89,12 @@ struct _CamelKolabIMAPXStoreClass {
 	                                      GCancellable *cancellable,
 	                                      GError **err);
 
+	gboolean (*set_folder_type) (CamelKolabIMAPXStore *self,
+	                             const gchar *foldername,
+	                             KolabFolderTypeID foldertype,
+	                             GCancellable *cancellable,
+	                             GError **err);
+
 	CamelFolderInfo* (*get_folder_info_online) (CamelKolabIMAPXStore *self,
 	                                            const gchar *top,
 	                                            CamelStoreGetFolderInfoFlags flags,
@@ -143,6 +149,14 @@ camel_kolab_imapx_store_get_folder_type (CamelKolabIMAPXStore *self,
                                          GCancellable *cancellable,
                                          GError **err);
 
+/* metadata: set the folder type id */
+gboolean
+camel_kolab_imapx_store_set_folder_type (CamelKolabIMAPXStore *self,
+                                         const gchar *foldername,
+                                         KolabFolderTypeID foldertype,
+                                         GCancellable *cancellable,
+                                         GError **err);
+
 /* online-query the folder info (no update of persistent DBs) */
 CamelFolderInfo*
 camel_kolab_imapx_store_get_folder_info_online (CamelKolabIMAPXStore *self,



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