aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-08-06 12:32:24 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-08-06 12:32:24 +0800
commita75f6e461db980ecbff380e6a5bf4757cec52bb2 (patch)
tree9c398cd824e6208dc38b8423eb47aadc0245c2d1 /mail/message-list.c
parent8a030c88e21c4f2bbd8ddf8eebbf3e8d2fe1117b (diff)
downloadgsoc2013-evolution-a75f6e461db980ecbff380e6a5bf4757cec52bb2.tar.gz
gsoc2013-evolution-a75f6e461db980ecbff380e6a5bf4757cec52bb2.tar.zst
gsoc2013-evolution-a75f6e461db980ecbff380e6a5bf4757cec52bb2.zip
Only count hidden messages which are in the folder. Should probably
2002-08-06 Not Zed <NotZed@Ximian.com> * message-list.c (message_list_hidden): Only count hidden messages which are in the folder. Should probably maintain hidden table better. For #4334. svn path=/trunk/; revision=17707
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index 0899c0071c..1ea817dd43 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -2329,6 +2329,24 @@ message_list_length (MessageList *ml)
return ml->hide_unhidden;
}
+struct _glibsuxcrap {
+ unsigned int count;
+ CamelFolder *folder;
+};
+
+static void
+glib_crapback(void *key, void *data, void *x)
+{
+ struct _glibsuxcrap *y = x;
+ CamelMessageInfo *mi;
+
+ mi = camel_folder_get_message_info(y->folder, key);
+ if (mi) {
+ y->count++;
+ camel_folder_free_message_info(y->folder, mi);
+ }
+}
+
/* returns number of hidden messages */
unsigned int
message_list_hidden(MessageList *ml)
@@ -2336,8 +2354,12 @@ message_list_hidden(MessageList *ml)
unsigned int hidden = 0;
MESSAGE_LIST_LOCK (ml, hide_lock);
- if (ml->hidden)
- hidden = g_hash_table_size (ml->hidden);
+ if (ml->hidden && ml->folder) {
+ /* this is a hack, should probably just maintain the hidden table better */
+ struct _glibsuxcrap x = { 0, ml->folder };
+ g_hash_table_foreach(ml->hidden, glib_crapback, &x);
+ hidden = x.count;
+ }
MESSAGE_LIST_UNLOCK (ml, hide_lock);
return hidden;
an class='deletions'>-1/+1 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-251-1/+0 * - Welcome X.org 7.2 \o/.flz2007-05-201-1/+1 * Bump PORTREVISION on glib12/gtk12 consumer ports to ease the upgrade path.ade2006-03-071-1/+1 * add SHA256.ume2005-11-091-0/+1 * Use PLIST_FILES (bento-tested, marcus-reviewed).trevor2004-02-062-1/+1 * SIZEfyume2004-02-041-0/+1 * Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-041-0/+1 * Remove the USE_GNOMENG macro.marcus2003-04-081-1/+0 * De-pkg-comment.ume2003-02-212-1/+1 * Use USE_GNOMENG.marcus2002-08-311-1/+2