From 9479a616f6b2de401b9f32db4ac568ebe0cede53 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 15 Jan 2004 07:21:14 +0000 Subject: ** See bug #52878. 2004-01-15 Not Zed ** See bug #52878. * em-folder-view.c (emfv_finalise): unhook message_changed too. (emfv_set_folder): hook/unhook message_changed too. (emfv_message_changed): implement, proxy to folder_changed. svn path=/trunk/; revision=24235 --- mail/em-folder-view.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'mail/em-folder-view.c') 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, -- cgit