[evolution-kolab/ek-wip-porting: 31/36] CamelImapxMetadata: added function for metadata removal
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/ek-wip-porting: 31/36] CamelImapxMetadata: added function for metadata removal
- Date: Tue, 18 Sep 2012 15:22:31 +0000 (UTC)
commit 4edc8348eb21d3600b7e8d8f4e779434c2f4c98d
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Tue Sep 18 15:14:15 2012 +0200
CamelImapxMetadata: added function for metadata removal
* added function which removes the metadata for a
mailbox from a CamelImapxMetadata instance
src/libekolab/camel-imapx-metadata.c | 29 ++++++++++++++++++++++++++++-
src/libekolab/camel-imapx-metadata.h | 4 ++++
2 files changed, 32 insertions(+), 1 deletions(-)
---
diff --git a/src/libekolab/camel-imapx-metadata.c b/src/libekolab/camel-imapx-metadata.c
index fe4f64b..b75e526 100644
--- a/src/libekolab/camel-imapx-metadata.c
+++ b/src/libekolab/camel-imapx-metadata.c
@@ -434,7 +434,7 @@ imapx_metadata_parse_annotation_response (CamelImapxMetadata *md,
}
/* add value data to attribute structure */
- len = strlen ((gchar*) attrib_value);
+ len = (guint) strlen ((gchar*) attrib_value);
ma->data[acc] = g_byte_array_new ();
g_byte_array_append (ma->data[acc],
attrib_value,
@@ -897,4 +897,31 @@ camel_imapx_metadata_get_attrib_from_metadata (CamelImapxMetadata *md,
return ma;
}
+gboolean
+camel_imapx_metadata_remove_metadata (CamelImapxMetadata *md,
+ const gchar *mailbox_name)
+{
+ gboolean found = FALSE;
+
+ if (md == NULL)
+ return FALSE;
+ if (mailbox_name == NULL)
+ return FALSE;
+
+ /* (acquire md lock ) */
+ g_mutex_lock (&(md->md_lock));
+
+ if (md->mboxes == NULL)
+ goto skip;
+
+ found = g_hash_table_remove (md->mboxes, mailbox_name);
+
+ skip:
+
+ /* (release md lock ) */
+ g_mutex_unlock (&(md->md_lock));
+
+ return found;
+}
+
/*----------------------------------------------------------------------------*/
diff --git a/src/libekolab/camel-imapx-metadata.h b/src/libekolab/camel-imapx-metadata.h
index 1a519d7..77aa395 100644
--- a/src/libekolab/camel-imapx-metadata.h
+++ b/src/libekolab/camel-imapx-metadata.h
@@ -179,6 +179,10 @@ CamelImapxMetadataAttrib*
camel_imapx_metadata_get_attrib_from_metadata (CamelImapxMetadata *md,
CamelImapxMetadataSpec *spec);
+gboolean
+camel_imapx_metadata_remove_metadata (CamelImapxMetadata *md,
+ const gchar *mailbox_name);
+
/*----------------------------------------------------------------------------*/
#endif /* _CAMEL_IMAPX_METADATA_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]