aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-folder-view.c')
-rw-r--r--mail/em-folder-view.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index ed4b444a8e..fd2801f904 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -82,6 +82,7 @@
#include "evolution-shell-component-utils.h" /* Pixmap stuff, sigh */
static void emfv_folder_changed(CamelFolder *folder, CamelFolderChangeInfo *changes, EMFolderView *emfv);
+static void emfv_message_changed(CamelFolder *folder, const char *uid, EMFolderView *emfv);
static void emfv_list_message_selected(MessageList *ml, const char *uid, EMFolderView *emfv);
static int emfv_list_right_click(ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, EMFolderView *emfv);
@@ -115,7 +116,7 @@ struct _EMFolderViewPrivate {
char *displayed_uid; /* only used to stop re-loads, don't use it to represent any selection state */
- CamelObjectHookID folder_changed_id;
+ CamelObjectHookID folder_changed_id, message_changed_id;
GtkWidget *invisible;
char *selection_uri;
@@ -188,6 +189,8 @@ emfv_finalise(GObject *o)
if (emfv->folder) {
if (p->folder_changed_id)
camel_object_remove_event(emfv->folder, p->folder_changed_id);
+ if (p->message_changed_id)
+ camel_object_remove_event(emfv->folder, p->message_changed_id);
camel_object_unref(emfv->folder);
g_free(emfv->folder_uri);
}
@@ -359,14 +362,16 @@ emfv_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri)
if (folder != emfv->folder) {
if (emfv->folder) {
mail_sync_folder (emfv->folder, NULL, NULL);
- if (emfv->priv->folder_changed_id)
- camel_object_remove_event(emfv->folder, emfv->priv->folder_changed_id);
+ camel_object_remove_event(emfv->folder, emfv->priv->folder_changed_id);
+ camel_object_remove_event(emfv->folder, emfv->priv->message_changed_id);
camel_object_unref(emfv->folder);
}
emfv->folder = folder;
if (folder) {
emfv->priv->folder_changed_id = camel_object_hook_event(folder, "folder_changed",
(CamelObjectEventHookFunc)emfv_folder_changed, emfv);
+ emfv->priv->message_changed_id = camel_object_hook_event(folder, "message_changed",
+ (CamelObjectEventHookFunc)emfv_message_changed, emfv);
camel_object_ref(folder);
}
}
@@ -1929,6 +1934,13 @@ emfv_folder_changed(CamelFolder *folder, CamelFolderChangeInfo *changes, EMFolde
mail_async_event_emit(emfv->async, MAIL_ASYNC_GUI, (MailAsyncFunc)emfv_gui_folder_changed, folder, NULL, emfv);
}
+static void
+emfv_message_changed(CamelFolder *folder, const char *uid, EMFolderView *emfv)
+{
+ g_object_ref(emfv);
+ mail_async_event_emit(emfv->async, MAIL_ASYNC_GUI, (MailAsyncFunc)emfv_gui_folder_changed, folder, NULL, emfv);
+}
+
/* keep these two tables in sync */
enum {
EMFV_ANIMATE_IMAGES = 1,