aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-03-09 07:33:32 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-03-09 07:33:32 +0800
commit180b0898db06e80d337411a41c254bd199b5f9a5 (patch)
tree356a5bf34eeedefd7ca0d9ce84cf55999f91b611 /camel
parent37dd7eb45c2ea9a4223d8f3fd7e74a76f2d209c2 (diff)
downloadgsoc2013-evolution-180b0898db06e80d337411a41c254bd199b5f9a5.tar
gsoc2013-evolution-180b0898db06e80d337411a41c254bd199b5f9a5.tar.gz
gsoc2013-evolution-180b0898db06e80d337411a41c254bd199b5f9a5.tar.bz2
gsoc2013-evolution-180b0898db06e80d337411a41c254bd199b5f9a5.tar.lz
gsoc2013-evolution-180b0898db06e80d337411a41c254bd199b5f9a5.tar.xz
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')
-rw-r--r--camel/ChangeLog8
-rw-r--r--camel/camel-store.c23
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);
+ }
}
}