diff options
author | Not Zed <NotZed@Ximian.com> | 2004-04-08 16:00:06 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-04-08 16:00:06 +0800 |
commit | 60f26ddd1a06fc251a56b34c4fc7aac0d0171cec (patch) | |
tree | 71fedcf8e6729cf66ce018dccd39ae8c33af39cb /mail/em-folder-view.c | |
parent | 313439d717171d45c9e2444e2128939c524f2d9c (diff) | |
download | gsoc2013-evolution-60f26ddd1a06fc251a56b34c4fc7aac0d0171cec.tar.gz gsoc2013-evolution-60f26ddd1a06fc251a56b34c4fc7aac0d0171cec.tar.zst gsoc2013-evolution-60f26ddd1a06fc251a56b34c4fc7aac0d0171cec.zip |
VJUNK_FOLDER's dont exist, they're VTRASH folders now.
2004-04-08 Not Zed <NotZed@Ximian.com>
* mail-folder-cache.c:
(update_1folder): VJUNK_FOLDER's dont exist, they're VTRASH
folders now.
* em-folder-view.c: remove message_changed stuff from camel folder
stuff.
* mail-component.c (mail_component_init): don't setup the search
context here, wait till its requested. Fixes #56672.
2004-04-07 Not Zed <NotZed@Ximian.com>
* mail-component.c (view_changed_cb): hook to update the info
label when the folderview changes.
* em-folder-view.c (emfv_class_init): added 2 signals 'loaded' and
'changed'. For when a folder is set/cleared or when some state
changes.
(emfv_set_folder): emit LOADED signal when we set the folder.
(emfv_list_message_selected): emit changed event.
(emfv_gui_folder_changed): emit changed event.
svn path=/trunk/; revision=25369
Diffstat (limited to 'mail/em-folder-view.c')
-rw-r--r-- | mail/em-folder-view.c | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index 418d8f0446..0d041d0117 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -82,7 +82,6 @@ #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); @@ -114,7 +113,7 @@ struct _EMFolderViewPrivate { guint seen_id; guint setting_notify_id; - CamelObjectHookID folder_changed_id, message_changed_id; + CamelObjectHookID folder_changed_id; GtkWidget *invisible; char *selection_uri; @@ -124,6 +123,8 @@ static GtkVBoxClass *emfv_parent; enum { EMFV_ON_URL, + EMFV_LOADED, + EMFV_CHANGED, LAST_SIGNAL }; @@ -187,8 +188,6 @@ 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); } @@ -257,6 +256,24 @@ emfv_class_init(GObjectClass *klass) em_marshal_VOID__STRING_STRING, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); + + signals[EMFV_LOADED] = g_signal_new("loaded", + G_OBJECT_CLASS_TYPE(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(EMFolderViewClass, loaded), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + signals[EMFV_CHANGED] = g_signal_new("changed", + G_OBJECT_CLASS_TYPE(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(EMFolderViewClass, on_url), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); } GType @@ -369,7 +386,6 @@ emfv_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri) if (emfv->folder) { mail_sync_folder (emfv->folder, NULL, NULL); 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); } @@ -377,12 +393,13 @@ emfv_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri) 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); } emfv_enable_menus(emfv); + + /* TODO: should probably be called after all processing, not just this class's impl */ + g_signal_emit(emfv, signals[EMFV_LOADED], 0); } static void @@ -1803,6 +1820,8 @@ emfv_list_message_selected(MessageList *ml, const char *uid, EMFolderView *emfv) } emfv_enable_menus(emfv); + + g_signal_emit(emfv, signals[EMFV_CHANGED], 0); } static void @@ -1965,6 +1984,8 @@ static void emfv_gui_folder_changed(CamelFolder *folder, void *dummy, EMFolderView *emfv) { emfv_enable_menus(emfv); + + g_signal_emit(emfv, signals[EMFV_LOADED], 0); g_object_unref(emfv); } @@ -1975,13 +1996,6 @@ 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, |