aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-store.c
diff options
context:
space:
mode:
author0 <NotZed@Ximian.com>2001-09-11 08:26:29 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-09-11 08:26:29 +0800
commitec9803b91dc499b6864c1d1a6a8cf615760d7649 (patch)
tree60a113d97c8db6e43902e8feb808e64192ba670b /camel/camel-store.c
parent2e238a7ebc19c49d607f8e17322540291ed67ad7 (diff)
downloadgsoc2013-evolution-ec9803b91dc499b6864c1d1a6a8cf615760d7649.tar.gz
gsoc2013-evolution-ec9803b91dc499b6864c1d1a6a8cf615760d7649.tar.zst
gsoc2013-evolution-ec9803b91dc499b6864c1d1a6a8cf615760d7649.zip
Progress reporting while moving messages.
2001-09-10 <NotZed@Ximian.com> * camel-folder.c (move_messages_to): Progress reporting while moving messages. * camel-store.c (camel_store_delete_folder): Make sure we remove the folder from our vtrash, if we have it in our opened set, and also remove it from our hashtable. (camel_store_rename_folder): Remove the old folder name from the folder cahce, if it is there. svn path=/trunk/; revision=12758
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r--camel/camel-store.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 0a0132e543..470ada7baf 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -293,7 +293,26 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
void
camel_store_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
{
+
CAMEL_STORE_LOCK(store, folder_lock);
+
+ /* if we deleted a folder, force it out of the cache, and also out of the vtrash if setup */
+ if (store->folders) {
+ CamelFolder *folder;
+ char *key;
+
+ CAMEL_STORE_LOCK(store, cache_lock);
+ if (g_hash_table_lookup_extended(store->folders, folder_name, &key, (void **)&folder)) {
+ g_hash_table_remove(store->folders, key);
+ g_free(key);
+ CAMEL_STORE_UNLOCK(store, cache_lock);
+ if (store->vtrash)
+ camel_vee_folder_remove_folder((CamelVeeFolder *)store->vtrash, folder);
+ } else {
+ CAMEL_STORE_UNLOCK(store, cache_lock);
+ }
+ }
+
CS_CLASS (store)->delete_folder (store, folder_name, ex);
CAMEL_STORE_UNLOCK(store, folder_lock);
}
@@ -319,7 +338,19 @@ rename_folder (CamelStore *store, const char *old_name,
void
camel_store_rename_folder (CamelStore *store, const char *old_name, const char *new_name, CamelException *ex)
{
+ char *key;
+ CamelFolder *folder;
+
CAMEL_STORE_LOCK(store, folder_lock);
+
+ /* remove the old name from the cache if it is there */
+ CAMEL_STORE_LOCK(store, cache_lock);
+ if (g_hash_table_lookup_extended(store->folders, old_name, &key, (void **)&folder)) {
+ g_hash_table_remove(store->folders, key);
+ g_free(key);
+ }
+ CAMEL_STORE_UNLOCK(store, cache_lock);
+
CS_CLASS (store)->rename_folder (store, old_name, new_name, ex);
CAMEL_STORE_UNLOCK(store, folder_lock);
}