From 180b0898db06e80d337411a41c254bd199b5f9a5 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 8 Mar 2001 23:33:32 +0000 Subject: Changes so that the folder gets added to the vtrash reguardless of whether 2001-03-08 Jeffrey Stedfast * camel-store.c (camel_store_get_folder): Changes so that the folder gets added to the vtrash reguardless of whether or not the store is holding it's own folder lookup hash. (init_trash): Oops, lets try locking the cache before we go and add all the cached folders to the vtrash. svn path=/trunk/; revision=8609 --- camel/ChangeLog | 8 ++++++++ camel/camel-store.c | 23 ++++++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index bda570f9bc..b3f6664ce1 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2001-03-08 Jeffrey Stedfast + + * camel-store.c (camel_store_get_folder): Changes so that the + folder gets added to the vtrash reguardless of whether or not the + store is holding it's own folder lookup hash. + (init_trash): Oops, lets try locking the cache before we go and + add all the cached folders to the vtrash. + 2001-03-08 Jeffrey Stedfast These fixes make it so that the CamelStore does not actually hold a ref on it's vTrash folder. The vTrash folder is now created ONLY diff --git a/camel/camel-store.c b/camel/camel-store.c index 78cd66de93..0f7fd6fa2e 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -217,20 +217,22 @@ camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flag camel_object_ref (CAMEL_OBJECT (folder)); CAMEL_STORE_UNLOCK(store, cache_lock); } - + if (!folder) { folder = CS_CLASS (store)->get_folder (store, folder_name, flags, ex); - if (folder && store->folders) { - CAMEL_STORE_LOCK(store, cache_lock); - - g_hash_table_insert (store->folders, g_strdup (folder_name), folder); - + if (folder) { /* Add the folder to the vTrash folder if this store implements it */ if (store->vtrash) camel_vee_folder_add_folder (CAMEL_VEE_FOLDER (store->vtrash), folder); - camel_object_hook_event (CAMEL_OBJECT (folder), "finalize", folder_finalize, store); - CAMEL_STORE_UNLOCK(store, cache_lock); + if (store->folders) { + CAMEL_STORE_LOCK(store, cache_lock); + + g_hash_table_insert (store->folders, g_strdup (folder_name), folder); + + camel_object_hook_event (CAMEL_OBJECT (folder), "finalize", folder_finalize, store); + CAMEL_STORE_UNLOCK(store, cache_lock); + } } } @@ -390,8 +392,11 @@ init_trash (CamelStore *store) trash_finalize, store); /* add all the pre-opened folders to the vtrash */ - if (store->folders) + if (store->folders) { + CAMEL_STORE_LOCK(store, cache_lock); g_hash_table_foreach (store->folders, trash_add_folder, store); + CAMEL_STORE_UNLOCK(store, cache_lock); + } } } -- cgit