aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-folder-cache.c
diff options
context:
space:
mode:
authorJonathon Jongsma <jonathon@quotidian.org>2009-12-12 04:37:49 +0800
committerJonathon Jongsma <jonathon@quotidian.org>2009-12-16 04:16:09 +0800
commit9c644867fe24587339531267d9e27890513c6292 (patch)
treeaf7bcb29e22814f5b39eafb20cfc2a2678973b63 /mail/mail-folder-cache.c
parent0eef4618ca677cd11d54ce0ae8804b5b1ededf3b (diff)
downloadgsoc2013-evolution-9c644867fe24587339531267d9e27890513c6292.tar
gsoc2013-evolution-9c644867fe24587339531267d9e27890513c6292.tar.gz
gsoc2013-evolution-9c644867fe24587339531267d9e27890513c6292.tar.bz2
gsoc2013-evolution-9c644867fe24587339531267d9e27890513c6292.tar.lz
gsoc2013-evolution-9c644867fe24587339531267d9e27890513c6292.tar.xz
gsoc2013-evolution-9c644867fe24587339531267d9e27890513c6292.tar.zst
gsoc2013-evolution-9c644867fe24587339531267d9e27890513c6292.zip
MailFolderCache: add signal for updated unread counts
Emit a signal when we have an updated unread count for a folder rather than pushing the update directly to a particular treemodel. This doesn't yet remove the dependency on EMFolderTreeModel, but it's a first step. https://bugzilla.gnome.org/show_bug.cgi?id=604627
Diffstat (limited to 'mail/mail-folder-cache.c')
-rw-r--r--mail/mail-folder-cache.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 769fa1df10..6b1be44753 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -98,6 +98,7 @@ enum
FOLDER_UNAVAILABLE,
FOLDER_DELETED,
FOLDER_RENAMED,
+ FOLDER_UNREAD_UPDATED,
LAST_SIGNAL
};
@@ -198,8 +199,8 @@ real_flush_updates (gpointer o, gpointer event_data, gpointer data)
}
/* update unread counts */
- em_folder_tree_model_set_unread_count (
- default_model, up->store, up->full_name, up->unread);
+ g_signal_emit (self, signals[FOLDER_UNREAD_UPDATED], 0,
+ up->store, up->full_name, up->unread);
if (up->uri) {
EMEvent *e = em_event_peek();
@@ -1268,6 +1269,24 @@ mail_folder_cache_class_init (MailFolderCacheClass *klass)
e_marshal_VOID__POINTER_STRING_STRING,
G_TYPE_NONE, 3,
G_TYPE_POINTER, G_TYPE_STRING, G_TYPE_STRING);
+
+ /**
+ * MailFolderCache::folder-unread-updated
+ * @store: the #CamelStore containing the folder
+ * @name: the name of the folder
+ * @unread: the number of unread mails in the folder
+ *
+ * Emitted when a we receive an update to the unread count for a folder
+ **/
+ signals[FOLDER_UNREAD_UPDATED] =
+ g_signal_new ("folder-unread-updated",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0, /* struct offset */
+ NULL, NULL, /* accumulator */
+ e_marshal_VOID__POINTER_STRING_INT,
+ G_TYPE_NONE, 3,
+ G_TYPE_POINTER, G_TYPE_STRING, G_TYPE_INT);
}
static void