[evolution-data-server/gnome-2-30] Bug #567000 - [IMAP] Renaming folder generates errors



commit f28e01590461c3cd74db1e1caaef752c3e462a31
Author: Milan Crha <mcrha redhat com>
Date:   Thu Apr 1 14:32:21 2010 +0200

    Bug #567000 - [IMAP] Renaming folder generates errors

 camel/providers/imap/camel-imap-store.c |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 77cd364..9239305 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -2226,7 +2226,6 @@ rename_folder (CamelStore *store, const gchar *old_name, const gchar *new_name_i
 	storage_path = g_strdup_printf("%s/folders", imap_store->storage_path);
 	oldpath = imap_path_to_physical (storage_path, old_name);
 	newpath = imap_path_to_physical (storage_path, new_name_in);
-	g_free(storage_path);
 
 	/* So do we care if this didn't work?  Its just a cache? */
 	if (g_rename (oldpath, newpath) == -1) {
@@ -2234,6 +2233,28 @@ rename_folder (CamelStore *store, const gchar *old_name, const gchar *new_name_i
 			   oldpath, newpath, g_strerror (errno));
 	}
 
+	if (CAMEL_STORE (imap_store)->folders) {
+		CamelFolder *folder;
+
+		folder = camel_object_bag_get (CAMEL_STORE (imap_store)->folders, old_name);
+		if (folder) {
+			CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
+
+			if (imap_folder && imap_folder->journal) {
+				gchar *folder_dir = imap_path_to_physical (storage_path, new_name_in);
+				gchar *path = g_strdup_printf ("%s/journal", folder_dir);
+
+				camel_offline_journal_set_filename (imap_folder->journal, path);
+
+				g_free (path);
+				g_free (folder_dir);
+			}
+
+			camel_object_unref (folder);
+		}
+	}
+
+	g_free (storage_path);
 	g_free (oldpath);
 	g_free (newpath);
 fail:



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