evolution-data-server r9481 - trunk/camel



Author: sragavan
Date: Fri Sep  5 03:11:29 2008
New Revision: 9481
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9481&view=rev

Log:
Don't commit, deleted folders.


Modified:
   trunk/camel/camel-vee-folder.c
   trunk/camel/camel-vee-folder.h

Modified: trunk/camel/camel-vee-folder.c
==============================================================================
--- trunk/camel/camel-vee-folder.c	(original)
+++ trunk/camel/camel-vee-folder.c	Fri Sep  5 03:11:29 2008
@@ -792,8 +792,9 @@
 		CAMEL_VEE_FOLDER_LOCK(folder, subfolder_lock);
 	}
 	CAMEL_VEE_FOLDER_UNLOCK(folder, subfolder_lock);
-
+	
 	((CamelFolderClass *)camel_vee_folder_parent)->delete(folder);
+	((CamelVeeFolder *)folder)->deleted = TRUE;
 }
 
 /* ********************************************************************** *
@@ -2048,6 +2049,7 @@
 	obj->search = camel_folder_search_new();
 	obj->hashes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
 	obj->loaded = g_hash_table_new (g_direct_hash, g_direct_equal);
+	obj->deleted = FALSE;
 	p->summary_lock = g_mutex_new();
 	p->subfolder_lock = g_mutex_new();
 	p->changed_lock = g_mutex_new();
@@ -2150,9 +2152,11 @@
 	p->destroyed = TRUE;
 
 	/* Save the counts to DB */
-	record = summary_header_to_db (((CamelFolder *)vf)->summary, NULL);
-	camel_db_write_folder_info_record (((CamelFolder *) vf)->parent_store->cdb, record, NULL);
-	g_free (record);
+	if (!vf->deleted) {
+		record = summary_header_to_db (((CamelFolder *)vf)->summary, NULL);
+		camel_db_write_folder_info_record (((CamelFolder *) vf)->parent_store->cdb, record, NULL);
+		g_free (record);
+	}
 	
 	/* This may invoke sub-classes with partially destroyed state, they must deal with this */
 	if (vf == folder_unmatched) {

Modified: trunk/camel/camel-vee-folder.h
==============================================================================
--- trunk/camel/camel-vee-folder.h	(original)
+++ trunk/camel/camel-vee-folder.h	Fri Sep  5 03:11:29 2008
@@ -53,6 +53,7 @@
 	struct _CamelVeeStore *parent_vee_store;
 	GHashTable *hashes;
 	GHashTable *loaded;
+	gboolean deleted;
 };
 
 struct _CamelVeeFolderClass {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]