[evolution-data-server/imap-notify: 9/40] CamelIMAPXStore: Add imapx_store_add_mailbox_to_folder().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/imap-notify: 9/40] CamelIMAPXStore: Add imapx_store_add_mailbox_to_folder().
- Date: Thu, 12 Sep 2013 17:02:17 +0000 (UTC)
commit 34361604964e7acb770951c5acf5b9c59908c79e
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Aug 29 09:45:37 2013 -0400
CamelIMAPXStore: Add imapx_store_add_mailbox_to_folder().
Called in response to CamelIMAPXServer::mailbox-created signals.
camel/camel-imapx-store.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-imapx-store.c b/camel/camel-imapx-store.c
index 1c31b33..ad6794c 100644
--- a/camel/camel-imapx-store.c
+++ b/camel/camel-imapx-store.c
@@ -328,10 +328,38 @@ imapx_store_rename_storage_path (CamelIMAPXStore *imapx_store,
}
static void
+imapx_store_add_mailbox_to_folder (CamelIMAPXStore *store,
+ CamelIMAPXMailbox *mailbox)
+{
+ CamelIMAPXFolder *folder;
+ const gchar *name;
+ gchar *folder_path;
+ gchar separator;
+
+ /* Add the CamelIMAPXMailbox to a cached CamelIMAPXFolder. */
+
+ name = camel_imapx_mailbox_get_name (mailbox);
+ separator = camel_imapx_mailbox_get_separator (mailbox);
+
+ folder_path = camel_imapx_mailbox_to_folder_path (name, separator);
+
+ folder = camel_object_bag_get (
+ CAMEL_STORE (store)->folders, folder_path);
+
+ if (folder != NULL) {
+ camel_imapx_folder_set_mailbox (folder, mailbox);
+ g_object_unref (folder);
+ }
+
+ g_free (folder_path);
+}
+
+static void
imapx_store_mailbox_created_cb (CamelIMAPXServer *server,
CamelIMAPXMailbox *mailbox,
CamelIMAPXStore *store)
{
+ imapx_store_add_mailbox_to_folder (store, mailbox);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]