aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-store.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-10-04 05:25:04 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-10-04 05:25:04 +0800
commit7708b2d8a0a0417758f4124e27614f576922ebdb (patch)
treedb08cfb368b79bb22a22e4cc45551b656ebbffce /camel/camel-store.c
parent63fe218a169ff409d8be7f85f9838c86b4cba3f1 (diff)
downloadgsoc2013-evolution-7708b2d8a0a0417758f4124e27614f576922ebdb.tar.gz
gsoc2013-evolution-7708b2d8a0a0417758f4124e27614f576922ebdb.tar.zst
gsoc2013-evolution-7708b2d8a0a0417758f4124e27614f576922ebdb.zip
Call camel_folder_delete() on the folder if it's "alive".
2001-10-03 Jeffrey Stedfast <fejj@ximian.com> * camel-store.c (camel_store_delete_folder): Call camel_folder_delete() on the folder if it's "alive". * camel-folder.c (camel_folder_delete): Mark the folder as deleted, perform any folder specific cleanup and emit the deleted event. (camel_folder_sync): Only sync the folder if it hasn't been deleted. (camel_folder_expunge): Same. svn path=/trunk/; revision=13388
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r--camel/camel-store.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 31b410604e..96c6a0c8bc 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -319,30 +319,33 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
void
camel_store_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
{
-
+ CamelFolder *folder = NULL;
+
CAMEL_STORE_LOCK(store, folder_lock);
-
- CS_CLASS (store)->delete_folder (store, folder_name, ex);
-
+
/* 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, (void **)&key, (void **)&folder)) {
- g_hash_table_remove(store->folders, key);
- g_free(key);
+ g_hash_table_remove (store->folders, key);
+ g_free (key);
camel_object_ref (CAMEL_OBJECT (folder));
- CAMEL_STORE_UNLOCK(store, cache_lock);
- if (store->vtrash)
- camel_vee_folder_remove_folder((CamelVeeFolder *)store->vtrash, folder);
- camel_object_unref (CAMEL_OBJECT (folder));
- } else {
- CAMEL_STORE_UNLOCK(store, cache_lock);
}
+
+ CAMEL_STORE_UNLOCK(store, cache_lock);
}
-
+
+ if (folder) {
+ if (store->vtrash)
+ camel_vee_folder_remove_folder((CamelVeeFolder *)store->vtrash, folder);
+ camel_folder_delete (folder);
+ camel_object_unref (CAMEL_OBJECT (folder));
+ }
+
+ CS_CLASS (store)->delete_folder (store, folder_name, ex);
+
CAMEL_STORE_UNLOCK(store, folder_lock);
}