From 3ff0b7854514639a8f8f740ec892b7e71c3b6912 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 10 Jan 2013 07:03:11 -0500 Subject: [PATCH] Bug 691466 - Cache reaper restores old IMAP cache directories Alter the name of the cache directory when moving it to trash. --- .../evolution-source-registry-migrate-imap-to-imapx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/evolution-source-registry/evolution-source-registry-migrate-imap-to-imapx.c b/services/evolution-source-registry/evolution-source-registry-migrate-imap-to-imapx.c index 4bfb237..dd95d4e 100644 --- a/services/evolution-source-registry/evolution-source-registry-migrate-imap-to-imapx.c +++ b/services/evolution-source-registry/evolution-source-registry-migrate-imap-to-imapx.c @@ -35,6 +35,7 @@ evolution_source_registry_migrate_imap_to_imapx (ESourceRegistryServer *server, GHashTable *settings; const gchar *group_name; gboolean backend_is_imap; + gchar *trash_name; gchar *cache_dir; gchar *trash_dir; gchar *value; @@ -127,8 +128,13 @@ evolution_source_registry_migrate_imap_to_imapx (ESourceRegistryServer *server, cache_dir = g_build_filename ( e_get_user_cache_dir (), "mail", uid, NULL); + + /* Alter the name of the target directory so + * the cache reaper module does not restore it. */ + trash_name = g_strdup_printf ("%s_old_imap", uid); trash_dir = g_build_filename ( - e_get_user_cache_dir (), "mail", "trash", uid, NULL); + e_get_user_cache_dir (), "mail", "trash", trash_name, NULL); + g_free (trash_name); if (g_rename (cache_dir, trash_dir) == -1) { g_warning ( -- 2.7.4