diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-03-09 07:33:32 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-03-09 07:33:32 +0800 |
commit | 180b0898db06e80d337411a41c254bd199b5f9a5 (patch) | |
tree | 356a5bf34eeedefd7ca0d9ce84cf55999f91b611 /camel/camel-store.c | |
parent | 37dd7eb45c2ea9a4223d8f3fd7e74a76f2d209c2 (diff) | |
download | gsoc2013-evolution-180b0898db06e80d337411a41c254bd199b5f9a5.tar.gz gsoc2013-evolution-180b0898db06e80d337411a41c254bd199b5f9a5.tar.zst gsoc2013-evolution-180b0898db06e80d337411a41c254bd199b5f9a5.zip |
Changes so that the folder gets added to the vtrash reguardless of whether
2001-03-08 Jeffrey Stedfast <fejj@ximian.com>
* 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
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r-- | camel/camel-store.c | 23 |
1 files changed, 14 insertions, 9 deletions
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); + } } } |