aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
author4 <NotZed@Ximian.com>2001-10-06 02:08:22 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-06 02:08:22 +0800
commitd8eb6abb187c001fda9a6626323b41153a58c2ef (patch)
treefac8074967de38294edd87198a5810ff53b75287 /camel
parent88a34e292b771b04d0102b3164cacbbbf228d54a (diff)
downloadgsoc2013-evolution-d8eb6abb187c001fda9a6626323b41153a58c2ef.tar
gsoc2013-evolution-d8eb6abb187c001fda9a6626323b41153a58c2ef.tar.gz
gsoc2013-evolution-d8eb6abb187c001fda9a6626323b41153a58c2ef.tar.bz2
gsoc2013-evolution-d8eb6abb187c001fda9a6626323b41153a58c2ef.tar.lz
gsoc2013-evolution-d8eb6abb187c001fda9a6626323b41153a58c2ef.tar.xz
gsoc2013-evolution-d8eb6abb187c001fda9a6626323b41153a58c2ef.tar.zst
gsoc2013-evolution-d8eb6abb187c001fda9a6626323b41153a58c2ef.zip
Change the order of execution slightly. We delete the folder first, then
2001-10-04 <NotZed@Ximian.com> * camel-store.c (camel_store_delete_folder): Change the order of execution slightly. We delete the folder first, then call the classes delete folder, then cleanup the hashtable afterwards. This is so deletes of vfolders work, since vee-store uses the folder hashtable to store all of is vfolders :-/ svn path=/trunk/; revision=13448
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog8
-rw-r--r--camel/camel-store.c33
-rw-r--r--camel/camel-vee-store.c1
3 files changed, 28 insertions, 14 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 8ec5a4f3b7..db705d2b8e 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,11 @@
+2001-10-04 <NotZed@Ximian.com>
+
+ * camel-store.c (camel_store_delete_folder): Change the order of
+ execution slightly. We delete the folder first, then call the
+ classes delete folder, then cleanup the hashtable afterwards.
+ This is so deletes of vfolders work, since vee-store uses the
+ folder hashtable to store all of is vfolders :-/
+
2001-10-04 Jeffrey Stedfast <fejj@ximian.com>
* camel-service.c (camel_service_connect): Unregister the
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 96c6a0c8bc..792dd6c6f9 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -320,32 +320,39 @@ void
camel_store_delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
{
CamelFolder *folder = NULL;
+ char *key;
CAMEL_STORE_LOCK(store, folder_lock);
/* if we deleted a folder, force it out of the cache, and also out of the vtrash if setup */
if (store->folders) {
- char *key;
-
+ CAMEL_STORE_LOCK(store, cache_lock);
+ folder = g_hash_table_lookup(store->folders, folder_name);
+ if (folder)
+ camel_object_ref((CamelObject *)folder);
+ CAMEL_STORE_UNLOCK(store, cache_lock);
+
+ if (folder) {
+ if (store->vtrash)
+ camel_vee_folder_remove_folder((CamelVeeFolder *)store->vtrash, folder);
+ camel_folder_delete (folder);
+ }
+ }
+
+ CS_CLASS (store)->delete_folder (store, folder_name, ex);
+
+ if (folder)
+ camel_object_unref((CamelObject *)folder);
+
+ if (store->folders) {
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);
- camel_object_ref (CAMEL_OBJECT (folder));
}
-
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);
}
diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c
index a5e2a43070..4530c34ee2 100644
--- a/camel/camel-vee-store.c
+++ b/camel/camel-vee-store.c
@@ -261,7 +261,6 @@ vee_delete_folder(CamelStore *store, const char *folder_name, CamelException *ex
if (store->vtrash)
camel_vee_folder_remove_folder((CamelVeeFolder *)store->vtrash, folder);
- /* FIXME: deleted event shoudl just pass out the folder name, not all this shit?? */
if (update) {
CamelFolderInfo *fi = g_malloc0(sizeof(*fi));