diff options
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/em-folder-view.c | 18 |
2 files changed, 23 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 27f5d574a0..b1b8932f2f 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,13 @@ 2004-01-15 Not Zed <NotZed@Ximian.com> + ** 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. + +2004-01-15 Not Zed <NotZed@Ximian.com> + ** See bugs #51609 and #43515. * em-format-html-display.c (efhd_format_prefix): output flag for 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, |