aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-05-09 12:16:52 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-05-09 12:16:52 +0000
commit8485d9c2127a377d1d5f78eb1c9758f12613391d (patch)
tree12db80352934ef9d6ddffde6ae61d29e222a3ff3 /src
parentc166012911365e43a7bd45e0ebce9a4ba1cfce8a (diff)
summaryview.c: don't decrease new/unread count if zero.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1065 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/summaryview.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/summaryview.c b/src/summaryview.c
index ebc3f2ce..8aeba1ed 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -2477,15 +2477,19 @@ static void summary_display_msg_full(SummaryView *summaryview,
if (val == 0 &&
(new_window || !prefs_common.mark_as_read_on_new_window)) {
- if (MSG_IS_NEW(msginfo->flags))
+ if (MSG_IS_NEW(msginfo->flags) &&
+ summaryview->folder_item->new > 0)
summaryview->folder_item->new--;
- if (MSG_IS_UNREAD(msginfo->flags))
+ if (MSG_IS_UNREAD(msginfo->flags) &&
+ summaryview->folder_item->unread > 0)
summaryview->folder_item->unread--;
if (summaryview->folder_item->stype == F_VIRTUAL) {
- if (MSG_IS_NEW(msginfo->flags))
+ if (MSG_IS_NEW(msginfo->flags) &&
+ msginfo->folder->new > 0)
msginfo->folder->new--;
- if (MSG_IS_UNREAD(msginfo->flags))
+ if (MSG_IS_UNREAD(msginfo->flags) &&
+ msginfo->folder->unread > 0)
msginfo->folder->unread--;
folderview_update_item(msginfo->folder, FALSE);
}
@@ -2728,15 +2732,17 @@ static void summary_mark_row_as_read(SummaryView *summaryview,
GET_MSG_INFO(msginfo, iter);
- if (MSG_IS_NEW(msginfo->flags))
+ if (MSG_IS_NEW(msginfo->flags) && summaryview->folder_item->new > 0)
summaryview->folder_item->new--;
- if (MSG_IS_UNREAD(msginfo->flags))
+ if (MSG_IS_UNREAD(msginfo->flags) &&
+ summaryview->folder_item->unread > 0)
summaryview->folder_item->unread--;
if (summaryview->folder_item->stype == F_VIRTUAL) {
- if (MSG_IS_NEW(msginfo->flags))
+ if (MSG_IS_NEW(msginfo->flags) && msginfo->folder->new > 0)
msginfo->folder->new--;
- if (MSG_IS_UNREAD(msginfo->flags))
+ if (MSG_IS_UNREAD(msginfo->flags) &&
+ msginfo->folder->unread > 0)
msginfo->folder->unread--;
folderview_update_item(msginfo->folder, FALSE);
}