evolution-data-server r8611 - trunk/camel/providers/imap



Author: mcrha
Date: Wed Apr  2 19:02:28 2008
New Revision: 8611
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8611&view=rev

Log:
2008-04-02  Milan Crha  <mcrha redhat com>

	** Fix for bug #369512

	* camel-imap-folder.c: (imap_sync_offline):
	Store to folder's and store's summary actual numbers
	of unread/total/deleted/junked mails, not the old one.



Modified:
   trunk/camel/providers/imap/ChangeLog
   trunk/camel/providers/imap/camel-imap-folder.c

Modified: trunk/camel/providers/imap/camel-imap-folder.c
==============================================================================
--- trunk/camel/providers/imap/camel-imap-folder.c	(original)
+++ trunk/camel/providers/imap/camel-imap-folder.c	Wed Apr  2 19:02:28 2008
@@ -1089,6 +1089,30 @@
 static void
 imap_sync_offline (CamelFolder *folder, CamelException *ex)
 {
+	if (folder->summary && (folder->summary->flags & CAMEL_SUMMARY_DIRTY) != 0) {
+		CamelStoreInfo *si;
+
+		/* Update also summary count info in folder's summary...  */
+		camel_object_get (folder, NULL,
+					CAMEL_FOLDER_UNREAD, &folder->summary->unread_count,
+					CAMEL_FOLDER_TOTAL, &folder->summary->saved_count,
+					CAMEL_FOLDER_DELETED, &folder->summary->deleted_count,
+					CAMEL_FOLDER_JUNKED, &folder->summary->junk_count,
+					NULL);
+
+		/* ... and store's summary when folder's summary is dirty */
+		si = camel_store_summary_path ((CamelStoreSummary *)((CamelImapStore *)folder->parent_store)->summary, folder->full_name);
+		if (si) {
+			if (si->total != folder->summary->saved_count || si->unread != folder->summary->unread_count) {
+				si->total = folder->summary->saved_count;
+				si->unread = folder->summary->unread_count;
+				camel_store_summary_touch ((CamelStoreSummary *)((CamelImapStore *)folder->parent_store)->summary);
+			}
+
+			camel_store_summary_info_free ((CamelStoreSummary *)((CamelImapStore *)folder->parent_store)->summary, si);
+		}
+	}
+
 	camel_folder_summary_save (folder->summary);
 	camel_store_summary_save((CamelStoreSummary *)((CamelImapStore *)folder->parent_store)->summary);
 }



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