evolution-data-server r9521 - trunk/camel



Author: sragavan
Date: Thu Sep 11 08:41:08 2008
New Revision: 9521
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9521&view=rev

Log:
2008-09-11  Srinivasa Ragavan  <sragavan novell com>

	* camel/camel-vee-folder.c: Make counts work even better.
	* camel/camel-vee-summary.c:
	* camel/camel-vee-summary.h: Do force counts better.


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

Modified: trunk/camel/camel-vee-folder.c
==============================================================================
--- trunk/camel/camel-vee-folder.c	(original)
+++ trunk/camel/camel-vee-folder.c	Thu Sep 11 08:41:08 2008
@@ -537,7 +537,7 @@
 	record->time = s->time;
 
 	record->saved_count = s->uids->len;
-	if ((s->visible_count) && !g_getenv("FORCE_VFOLDER_COUNT")) {
+	if (!(((CamelVeeSummary *) s)->force_counts) && !g_getenv("FORCE_VFOLDER_COUNT")) {
 		/* We should be in sync always. so use the count. Don't search.*/
 		record->junk_count = s->junk_count;
 		record->deleted_count = s->deleted_count;
@@ -620,8 +620,7 @@
 vee_expunge (CamelFolder *folder, CamelException *ex)
 {
 	/* Force it to rebuild the counts, when some folders were expunged. */
-	folder->summary->unread_count = 0;
-	folder->summary->visible_count = 0;
+	((CamelVeeSummary *) folder->summary)->force_counts = TRUE;
 	((CamelFolderClass *)((CamelObject *)folder)->klass)->sync(folder, TRUE, ex);
 }
 

Modified: trunk/camel/camel-vee-summary.c
==============================================================================
--- trunk/camel/camel-vee-summary.c	(original)
+++ trunk/camel/camel-vee-summary.c	Thu Sep 11 08:41:08 2008
@@ -184,8 +184,11 @@
 				 CAMEL_FOLDER_JUNKED, &old_junked,
 				 CAMEL_FOLDER_JUNKED_NOT_DELETED, &old_junked_not_deleted,
 				 CAMEL_FOLDER_UNREAD, &old_unread, NULL);		
+		camel_folder_freeze(rmi->summary->folder);
 		res = camel_message_info_set_flags(rmi, flags, set);
 		((CamelVeeMessageInfo *) mi)->old_flags = camel_message_info_flags (rmi);
+		camel_folder_thaw(rmi->summary->folder);
+	
 		camel_object_get(rmi->summary->folder, NULL,
 				 CAMEL_FOLDER_DELETED, &deleted,
 				 CAMEL_FOLDER_VISIBLE, &visible,
@@ -324,6 +327,7 @@
 
 	s = (CamelVeeSummary *)camel_object_new(camel_vee_summary_get_type());
 	s->summary.folder = parent;
+	s->force_counts = FALSE;
 
         #warning "fix exceptions and note return values"
 	#warning "if Evo's junk/trash vfolders make it VJunk VTrash instead of .#evolution/Junk-or-whatever"		

Modified: trunk/camel/camel-vee-summary.h
==============================================================================
--- trunk/camel/camel-vee-summary.h	(original)
+++ trunk/camel/camel-vee-summary.h	Thu Sep 11 08:41:08 2008
@@ -48,6 +48,7 @@
 
 struct _CamelVeeSummary {
 	CamelFolderSummary summary;
+	gboolean force_counts;
 };
 
 struct _CamelVeeSummaryClass {



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