diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-11-05 10:30:04 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-11-05 10:30:04 +0000 |
commit | 1bf86f0537be17e8a28ba316092e10bd44669e54 (patch) | |
tree | c53c2216b295d2fef293d1146989c9f58e6de882 /libsylph/imap.c | |
parent | 17e2ef839a0ee675d9483136c6d6189b2ffc7f3e (diff) |
add a new flag: RemoteFolder::remove_cache_on_destroy.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2334 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/imap.c')
-rw-r--r-- | libsylph/imap.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/libsylph/imap.c b/libsylph/imap.c index 7459e71c..c69ed0fe 100644 --- a/libsylph/imap.c +++ b/libsylph/imap.c @@ -476,20 +476,22 @@ static Folder *imap_folder_new(const gchar *name, const gchar *path) static void imap_folder_destroy(Folder *folder) { - gchar *dir; - g_return_if_fail(folder->account != NULL); - dir = folder_get_path(folder); - if (is_dir_exist(dir)) - remove_dir_recursive(dir); - g_free(dir); + if (REMOTE_FOLDER(folder)->remove_cache_on_destroy) { + gchar *dir; - dir = g_strconcat(get_imap_cache_dir(), G_DIR_SEPARATOR_S, - folder->account->recv_server, NULL); - if (is_dir_exist(dir)) - g_rmdir(dir); - g_free(dir); + dir = folder_get_path(folder); + if (is_dir_exist(dir)) + remove_dir_recursive(dir); + g_free(dir); + + dir = g_strconcat(get_imap_cache_dir(), G_DIR_SEPARATOR_S, + folder->account->recv_server, NULL); + if (is_dir_exist(dir)) + g_rmdir(dir); + g_free(dir); + } folder_remote_folder_destroy(REMOTE_FOLDER(folder)); } |