evolution-data-server r9552 - trunk/camel
- From: sragavan svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r9552 - trunk/camel
- Date: Mon, 15 Sep 2008 11:30:01 +0000 (UTC)
Author: sragavan
Date: Mon Sep 15 11:30:01 2008
New Revision: 9552
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9552&view=rev
Log:
2008-09-15 Srinivasa Ragavan <sragavan novell com>
* camel-folder-summary.c (info_set_flags): Fix for counts on junk
* camel-vee-folder.c (update_summary), (folder_changed_change_uid):
* camel-vtrash-folder.c (vtrash_getv),
(camel_vtrash_folder_class_init):
Modified:
trunk/camel/ChangeLog
trunk/camel/camel-folder-summary.c
trunk/camel/camel-vee-folder.c
trunk/camel/camel-vtrash-folder.c
Modified: trunk/camel/camel-folder-summary.c
==============================================================================
--- trunk/camel/camel-folder-summary.c (original)
+++ trunk/camel/camel-folder-summary.c Mon Sep 15 11:30:01 2008
@@ -4542,8 +4542,13 @@
return FALSE;
if (mi->summary) {
- if (read)
+ if (read && junk == 0 && !(mi->flags & CAMEL_MESSAGE_JUNK))
mi->summary->unread_count -= read;
+ else if (junk > 0)
+ mi->summary->unread_count -= (old & CAMEL_MESSAGE_SEEN) ? 0 : 1;
+ else if (junk < 0)
+ mi->summary->unread_count -= (old & CAMEL_MESSAGE_SEEN) ? 0 : -1;
+
if (deleted)
mi->summary->deleted_count += deleted;
if (junk)
Modified: trunk/camel/camel-vee-folder.c
==============================================================================
--- trunk/camel/camel-vee-folder.c (original)
+++ trunk/camel/camel-vee-folder.c Mon Sep 15 11:30:01 2008
@@ -1221,7 +1221,7 @@
int unread=0, deleted=0, junk=0;
CamelFolderSummary *summary = ((CamelMessageInfo *) mi)->summary;
- if (!(flags & CAMEL_MESSAGE_SEEN))
+ if (!(flags & CAMEL_MESSAGE_SEEN) && !(flags & CAMEL_MESSAGE_JUNK))
unread = 1;
if (flags & CAMEL_MESSAGE_DELETED)
@@ -1251,7 +1251,7 @@
} else {
oldflags = use_old ? oldflags : flags;
unread = deleted = junk = 0;
- if (!(oldflags & CAMEL_MESSAGE_SEEN))
+ if (!(oldflags & CAMEL_MESSAGE_SEEN) && !(oldflags & CAMEL_MESSAGE_JUNK))
unread -= 1;
if (oldflags & CAMEL_MESSAGE_DELETED)
@@ -1274,7 +1274,7 @@
summary->saved_count--;
}
} else {
- if (!(oldflags & CAMEL_MESSAGE_SEEN))
+ if (!(oldflags & CAMEL_MESSAGE_SEEN) && !(oldflags & CAMEL_MESSAGE_JUNK))
unread -= 1;
if (oldflags & CAMEL_MESSAGE_DELETED)
@@ -1410,8 +1410,9 @@
info = camel_folder_get_message_info(sub, uid);
if (info) {
if (vinfo) {
+ guint32 of = vinfo->old_flags;
camel_folder_change_info_change_uid(vf->changes, vuid);
- update_summary (vinfo, camel_message_info_flags(info), vinfo->old_flags, FALSE /* Doesn't matter */, TRUE);
+ update_summary (vinfo, camel_message_info_flags(info), of, FALSE /* Doesn't matter */, TRUE);
camel_message_info_free((CamelMessageInfo *)vinfo);
}
Modified: trunk/camel/camel-vtrash-folder.c
==============================================================================
--- trunk/camel/camel-vtrash-folder.c (original)
+++ trunk/camel/camel-vtrash-folder.c Mon Sep 15 11:30:01 2008
@@ -138,13 +138,17 @@
/* This is so we can get the values atomically, and also so we can calculate them only once */
if (unread == -1) {
int j;
- CamelMessageInfo *info;
+ CamelMessageInfoBase *info;
+ CamelVeeMessageInfo *vinfo;
unread = 0;
count = camel_folder_summary_count(folder->summary);
for (j=0; j<count; j++) {
- if ((info = camel_folder_summary_index(folder->summary, j))) {
- guint32 flags = camel_message_info_flags(info);
+ if ((info = (CamelMessageInfoBase *) camel_folder_summary_index(folder->summary, j))) {
+ guint32 flags;
+
+ vinfo = (CamelVeeMessageInfo *) info;
+ flags = vinfo->old_flags ? vinfo->old_flags : camel_message_info_flags(info);
if ((flags & (CAMEL_MESSAGE_SEEN)) == 0)
unread++;
@@ -637,7 +641,7 @@
camel_vtrash_folder_parent = CAMEL_VEE_FOLDER_CLASS(camel_vee_folder_get_type());
/* Not required from here on. We don't count */
- /* ((CamelObjectClass *)klass)->getv = vtrash_getv; */
+ ((CamelObjectClass *)klass)->getv = vtrash_getv;
folder_class->append_message = vtrash_append_message;
folder_class->transfer_messages_to = vtrash_transfer_messages_to;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]