aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/vee
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-07-10 15:30:59 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-07-10 15:30:59 +0800
commit3e2188235f0cde226477d268aa4928ebb83af831 (patch)
tree5daf1b2bc32a1b4d766c089692fa4f9a80a38292 /camel/providers/vee
parentcccc6d3b5b40488dfdf8354ce78b8ad65b50e74a (diff)
downloadgsoc2013-evolution-3e2188235f0cde226477d268aa4928ebb83af831.tar
gsoc2013-evolution-3e2188235f0cde226477d268aa4928ebb83af831.tar.gz
gsoc2013-evolution-3e2188235f0cde226477d268aa4928ebb83af831.tar.bz2
gsoc2013-evolution-3e2188235f0cde226477d268aa4928ebb83af831.tar.lz
gsoc2013-evolution-3e2188235f0cde226477d268aa4928ebb83af831.tar.xz
gsoc2013-evolution-3e2188235f0cde226477d268aa4928ebb83af831.tar.zst
gsoc2013-evolution-3e2188235f0cde226477d268aa4928ebb83af831.zip
Implemented.
2000-07-10 Jeffrey Stedfast <fejj@helixcode.com> * providers/mbox/camel-mbox-folder.c (mbox_get_unread_message_count): * providers/vee/camel-vee-folder.c (vee_get_unread_message_count): * providers/imap/camel-imap-folder.c (imap_get_unread_message_count): Implemented. * camel-folder.c (camel_folder_get_unread_message_count): New convenience function to allow the mailer to query the number of unread messages in a folder (for displaying message stats in a folder tree?). svn path=/trunk/; revision=4028
Diffstat (limited to 'camel/providers/vee')
-rw-r--r--camel/providers/vee/camel-vee-folder.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/camel/providers/vee/camel-vee-folder.c b/camel/providers/vee/camel-vee-folder.c
index 745e9a78ea..dea476eb13 100644
--- a/camel/providers/vee/camel-vee-folder.c
+++ b/camel/providers/vee/camel-vee-folder.c
@@ -2,6 +2,7 @@
* Copyright (C) 2000 Helix Code Inc.
*
* Authors: Michael Zucchi <notzed@helixcode.com>
+ * Jeffrey Stedfast <fejj@helixcode.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -49,6 +50,7 @@ GPtrArray *vee_get_summary (CamelFolder *folder, CamelException *ex);
void vee_free_summary (CamelFolder *folder, GPtrArray *array);
static gint vee_get_message_count (CamelFolder *folder, CamelException *ex);
+static gint vee_get_unread_message_count (CamelFolder *folder, CamelException *ex);
static CamelMimeMessage *vee_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex);
static const CamelMessageInfo *vee_get_message_info (CamelFolder *folder, const char *uid);
@@ -118,6 +120,7 @@ camel_vee_folder_class_init (CamelVeeFolderClass *klass)
folder_class->get_message_info = vee_get_message_info;
folder_class->get_message_count = vee_get_message_count;
+ folder_class->get_unread_message_count = vee_get_unread_message_count;
folder_class->search_by_expression = vee_search_by_expression;
folder_class->get_message_flags = vee_get_message_flags;
@@ -292,6 +295,27 @@ static gint vee_get_message_count (CamelFolder *folder, CamelException *ex)
return vf->messages->len;
}
+static gint
+vee_get_unread_message_count (CamelFolder *folder, CamelException *ex)
+{
+ CamelVeeFolder *vee_folder = CAMEL_VEE_FOLDER (folder);
+ CamelMessageInfo *info;
+ GPtrArray *infolist;
+ gint i, count = 0;
+
+ g_return_val_if_fail (folder != NULL, -1);
+
+ infolist = vee_folder->messages;
+
+ for (i = 0; i < infolist->len; i++) {
+ info = (CamelMessageInfo *) g_ptr_array_index (infolist, i);
+ if (!(info->flags & CAMEL_MESSAGE_SEEN))
+ count++;
+ }
+
+ return count;
+}
+
static gboolean
get_real_message (CamelFolder *folder, const char *uid,
CamelFolder **out_folder, const char **out_uid,