aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-folder-cache.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-12-11 02:36:13 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-12-11 02:36:13 +0800
commite3262cdc7e24aece3074a0c92ce3e529acf3568e (patch)
treedc850b54b73d9a9b448158e4da830699c1142136 /mail/mail-folder-cache.c
parent82bfd7cc1cc8f00cd86c87a6132678145bfa0776 (diff)
downloadgsoc2013-evolution-e3262cdc7e24aece3074a0c92ce3e529acf3568e.tar
gsoc2013-evolution-e3262cdc7e24aece3074a0c92ce3e529acf3568e.tar.gz
gsoc2013-evolution-e3262cdc7e24aece3074a0c92ce3e529acf3568e.tar.bz2
gsoc2013-evolution-e3262cdc7e24aece3074a0c92ce3e529acf3568e.tar.lz
gsoc2013-evolution-e3262cdc7e24aece3074a0c92ce3e529acf3568e.tar.xz
gsoc2013-evolution-e3262cdc7e24aece3074a0c92ce3e529acf3568e.tar.zst
gsoc2013-evolution-e3262cdc7e24aece3074a0c92ce3e529acf3568e.zip
Update the unread count in the model if the folder got new mail.
2003-12-10 Jeffrey Stedfast <fejj@ximian.com> * mail-folder-cache.c (real_flush_updates): Update the unread count in the model if the folder got new mail. * em-folder-selection.c (em_select_folder): Updated. * em-folder-selection-button.c (em_folder_selection_button_clicked): Updated. * em-folder-tree-model.c (em_folder_tree_model_set_unread_count): New function to update the unread count for a folder. * mail-component.c (mail_component_peek_tree_model): Don't ref the model. Also renamed s/get/peek/ svn path=/trunk/; revision=23910
Diffstat (limited to 'mail/mail-folder-cache.c')
-rw-r--r--mail/mail-folder-cache.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 23f6221544..750f9ab30d 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -45,11 +45,13 @@
#include "mail-folder-cache.h"
#include "mail-ops.h"
#include "mail-session.h"
+#include "mail-component.h"
/* For notifications of changes */
#include "mail-vfolder.h"
#include "mail-autofilter.h"
#include "mail-config.h"
+#include "em-folder-tree-model.h"
#define w(x)
#define d(x) /*(printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__), (x))*/
@@ -182,10 +184,15 @@ notify_type_changed (GConfClient *client, guint cnxn_id,
static void
real_flush_updates(void *o, void *event_data, void *data)
{
+ struct _MailComponent *component;
+ struct _EMFolderTreeModel *model;
struct _folder_update *up;
struct _store_info *si;
time_t now;
-
+
+ component = mail_component_peek ();
+ model = mail_component_peek_tree_model (component);
+
LOCK(info_lock);
while ((up = (struct _folder_update *)e_dlist_remhead(&updates))) {
si = g_hash_table_lookup(stores, up->store);
@@ -214,6 +221,9 @@ real_flush_updates(void *o, void *event_data, void *data)
mail_vfolder_add_uri(up->store, up->uri, FALSE);
}
+ /* update unread counts */
+ em_folder_tree_model_set_unread_count (model, up->store, up->path, up->unread);
+
/* new mail notification */
if (notify_type == -1) {
/* need to track the user's new-mail-notification settings... */