diff options
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/camel-store.c | 23 |
2 files changed, 22 insertions, 9 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index bda570f9bc..b3f6664ce1 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,4 +1,12 @@ 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. + +2001-03-08 Jeffrey Stedfast <fejj@ximian.com> 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 when it is requested. This solves the problem of not being able to 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); + } } } |