aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorParthasarathi Susarla <sparthasarathi@novell.com>2005-12-20 14:34:12 +0800
committerParthasarathi Susarla <saps@src.gnome.org>2005-12-20 14:34:12 +0800
commit319c71b6cf5cf4f756875ecff7bd3b5ab8aad355 (patch)
treefc60d46276bb7cab3d23e2b56c89d9f9af2137ce /mail
parent3c92eec7766525e59ea1c74123ff42dd8c5424c8 (diff)
downloadgsoc2013-evolution-319c71b6cf5cf4f756875ecff7bd3b5ab8aad355.tar.gz
gsoc2013-evolution-319c71b6cf5cf4f756875ecff7bd3b5ab8aad355.tar.zst
gsoc2013-evolution-319c71b6cf5cf4f756875ecff7bd3b5ab8aad355.zip
** See bug 234008
2005-12-20 Parthasarathi Susarla <sparthasarathi@novell.com> ** See bug 234008 * em-folder-tree-model.c: * mail-folder-cache.c: Make sure that the Draft folder highlights the number of messages in it svn path=/trunk/; revision=30891
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/em-folder-tree-model.c14
-rw-r--r--mail/mail-folder-cache.c4
3 files changed, 26 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 0a00cb29fe..3d4a9e0774 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2005-12-20 Parthasarathi Susarla <sparthasarathi@novell.com>
+
+ ** See bug 234008
+
+ * em-folder-tree-model.c:
+ * mail-folder-cache.c:
+ Make sure that the Draft folder highlights the number of messages in
+ it
+
2005-12-18 Tor Lillqvist <tml@novell.com>
* Makefile.am: Use THREADS_CFLAGS and _LIBS. Don't need CAMEL_LIBS.
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 7cc83be033..5b30993ce3 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -443,6 +443,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
g_hash_table_insert (si->full_hash, g_strdup (fi->full_name), path_row);
/* HACK: if we have the folder, and its the outbox folder, we need the total count, not unread */
+ /* HACK2: We do the same to the draft folder */
/* This is duplicated in mail-folder-cache too, should perhaps be functionised */
unread = fi->unread;
if (mail_note_get_folder_from_uri(fi->uri, &folder) && folder) {
@@ -457,8 +458,21 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
}
unread = total > 0 ? total : 0;
+ }
+ if (folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_DRAFTS)) {
+ int total;
+
+ if ((total = camel_folder_get_message_count (folder)) > 0) {
+ int deleted = camel_folder_get_deleted_message_count (folder);
+
+ if (deleted != -1)
+ total -= deleted;
+ }
+
+ unread = total > 0 ? total : 0;
}
camel_object_unref(folder);
+
}
/* TODO: maybe this should be handled by mail_get_folderinfo (except em-folder-tree doesn't use it, duh) */
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 6f4fda244e..ce41ed69fd 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -352,10 +352,12 @@ update_1folder(struct _folder_info *mfi, int new, CamelFolderInfo *info)
d(printf("update 1 folder '%s'\n", folder->full_name));
if ((count_trash && (CAMEL_IS_VTRASH_FOLDER (folder)))
|| folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_OUTBOX)
+ || folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_DRAFTS)
|| (count_sent && folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_SENT))) {
d(printf(" total count\n"));
unread = camel_folder_get_message_count (folder);
- if (folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_OUTBOX)) {
+ if (folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_OUTBOX)
+ || folder == mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_DRAFTS)) {
if ((deleted = camel_folder_get_deleted_message_count (folder)) > 0)
unread -= deleted;
}