[evolution-kolab/ek-wip-porting: 32/36] CamelIMAPXExtdStore: metadata handling for folder create/store
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/ek-wip-porting: 32/36] CamelIMAPXExtdStore: metadata handling for folder create/store
- Date: Tue, 18 Sep 2012 15:22:36 +0000 (UTC)
commit 54daa299abf871f2d84e874befa1260274e164f3
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Tue Sep 18 15:16:17 2012 +0200
CamelIMAPXExtdStore: metadata handling for folder create/store
* when creating a new folder, no need to do more than
what our parent does - CamelKolabIMAPXStore, which uses
us, will take care of setting folder metadata
* when deleting a folder, we drop the metadata for that
folder from our in-mem cache (hash table) so we do not
accidentally return wrong annotation data in the event
of a folder of the same name being created later on
src/libekolab/camel-imapx-extd-store.c | 29 +++++++++++++++++++++--------
1 files changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/src/libekolab/camel-imapx-extd-store.c b/src/libekolab/camel-imapx-extd-store.c
index f9e965e..5f3c371 100644
--- a/src/libekolab/camel-imapx-extd-store.c
+++ b/src/libekolab/camel-imapx-extd-store.c
@@ -260,9 +260,10 @@ imapx_extd_store_create_folder_sync (CamelStore *self,
foldername,
cancellable,
err);
- /* FIXME set annotation data on server */
- g_warning ("%s()[%u] FIXME set annotation data on server",
- __func__, __LINE__);
+ /* the folder annotation needs to be set by the
+ * class which uses CamelIMAPXExtdStore (i.e.,
+ * CamelKolabIMAPXStore)
+ */
return fi;
}
@@ -273,6 +274,9 @@ imapx_extd_store_delete_folder_sync (CamelStore *self,
GCancellable *cancellable,
GError **err)
{
+ CamelIMAPXExtdStore *myself = NULL;
+ CamelIMAPXExtdStorePrivate *priv = NULL;
+
gboolean ok = FALSE;
g_assert (CAMEL_IS_IMAPX_EXTD_STORE (self));
@@ -284,11 +288,20 @@ imapx_extd_store_delete_folder_sync (CamelStore *self,
foldername,
cancellable,
err);
-
- /* FIXME delete annotation data from server */
- g_warning ("%s()[%u] FIXME delete annotation data from server",
- __func__, __LINE__);
-
+ if (ok) {
+ myself = CAMEL_IMAPX_EXTD_STORE (self);
+ priv = CAMEL_IMAPX_EXTD_STORE_PRIVATE (myself);
+
+ /* delete folder metadata entry from our
+ * hash table so we will not return a wrong
+ * folder annotation if a folder with the
+ * same name but different annotation gets
+ * created later on
+ */
+ (void) camel_imapx_metadata_remove_metadata (priv->md,
+ foldername);
+ }
+
return ok;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]