[evolution-data-server] Update store<=>folder summaries connection on folder rename
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Update store<=>folder summaries connection on folder rename
- Date: Wed, 7 Mar 2012 19:18:35 +0000 (UTC)
commit 07b1c5de5be3d6fcdeb90144e374fa49e59fc607
Author: Milan Crha <mcrha redhat com>
Date: Wed Mar 7 20:17:33 2012 +0100
Update store<=>folder summaries connection on folder rename
camel/providers/imap/camel-imap-folder.c | 8 ++++++++
camel/providers/imapx/camel-imapx-folder.c | 20 ++++++++++++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 1ee2271..a0aeda1 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -778,7 +778,15 @@ imap_rename (CamelFolder *folder,
g_free (folder_dir);
+ camel_store_summary_disconnect_folder_summary (
+ (CamelStoreSummary *) ((CamelImapStore *) parent_store)->summary,
+ folder->summary);
+
CAMEL_FOLDER_CLASS (camel_imap_folder_parent_class)->rename (folder, new);
+
+ camel_store_summary_connect_folder_summary (
+ (CamelStoreSummary *) ((CamelImapStore *) parent_store)->summary,
+ camel_folder_get_full_name (folder), folder->summary);
}
/* called with connect_lock locked */
diff --git a/camel/providers/imapx/camel-imapx-folder.c b/camel/providers/imapx/camel-imapx-folder.c
index 7122f7e..f73fe70 100644
--- a/camel/providers/imapx/camel-imapx-folder.c
+++ b/camel/providers/imapx/camel-imapx-folder.c
@@ -711,6 +711,25 @@ imapx_transfer_messages_to_sync (CamelFolder *source,
}
static void
+imapx_rename (CamelFolder *folder,
+ const gchar *new_name)
+{
+ CamelStore *parent_store;
+
+ parent_store = camel_folder_get_parent_store (folder);
+
+ camel_store_summary_disconnect_folder_summary (
+ (CamelStoreSummary *) ((CamelIMAPXStore *) parent_store)->summary,
+ folder->summary);
+
+ CAMEL_FOLDER_CLASS (camel_imapx_folder_parent_class)->rename (folder, new_name);
+
+ camel_store_summary_connect_folder_summary (
+ (CamelStoreSummary *) ((CamelIMAPXStore *) parent_store)->summary,
+ camel_folder_get_full_name (folder), folder->summary);
+}
+
+static void
camel_imapx_folder_class_init (CamelIMAPXFolderClass *class)
{
GObjectClass *object_class;
@@ -723,6 +742,7 @@ camel_imapx_folder_class_init (CamelIMAPXFolderClass *class)
object_class->finalize = imapx_folder_finalize;
folder_class = CAMEL_FOLDER_CLASS (class);
+ folder_class->rename = imapx_rename;
folder_class->search_by_expression = imapx_search_by_expression;
folder_class->search_by_uids = imapx_search_by_uids;
folder_class->count_by_expression = imapx_count_by_expression;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]