aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
authorMichael Zucci <zucchi@src.gnome.org>2001-10-17 03:13:31 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-17 03:13:31 +0800
commit8c85ed61ba64bd548460543dd87445b9a21dbf6a (patch)
tree76d2bc77eb83263b4d5b4122bf47127a1666214b /mail/message-list.c
parente1d0f3dc45692a04dbd93c7ef82c24af74e05f25 (diff)
downloadgsoc2013-evolution-8c85ed61ba64bd548460543dd87445b9a21dbf6a.tar.gz
gsoc2013-evolution-8c85ed61ba64bd548460543dd87445b9a21dbf6a.tar.zst
gsoc2013-evolution-8c85ed61ba64bd548460543dd87445b9a21dbf6a.zip
Added an async_event handler to store_info. (mail_note_store): Setup async
* mail-folder-cache.c: Added an async_event handler to store_info. (mail_note_store): Setup async event handler here. (store_finalised): Flush out async events here. (folder_changed): Use async event handler to emit event. (mail_note_folder): Chagned, do most of the work in the calling context, only do the corba stuff in main. (store_folder_subscribed): Use async event, and do more work locally. (store_folder_unsubscribed): Same. (store_folder_deleted): Call store_folder_unsubscribed if we have to do any work. (store_folder_created): Call store_folder_subscribed if we have to do any work. (store_folder_unsubscribed): Ref store while busy. (real_folder_deleted): And unref here. (store_folder_subscribed): Reg store while busy. (real_folder_created): Unref here. (mail_note_folder): Ref folder while busy. (real_note_folder): And unref here. (mail_note_folder): Hook onto folder_deleted event. (folder_deleted): Just mark this folder as no longer available. * mail-session.c (register_timeout): Use mail_call_main instead of proxy_event. (remove_timeout): Same here. * folder-browser.c (folder_changed): use the new mail_async_event stuff. (folder_changed_main): Remove old async event handling stuff. (FOLDER_BROWSER_LOCK/UNLOCK): Removed. (FolderBrowserPrivate): Removed too, sigh. * mail-mt.c (mail_async_event_new, mail_async_event_emit, mail_async_event_destroy): New functions to handle async events. (mail_proxy_event, mail_proxy_event_id): Removed old functions for async events. (do_call): Add suport for MAIL_CALL_p_pp. (mail_msg_free): Use mail_async_event instead of proxy_event. * message-list.c (message_changed): Promote the message_changed to a folder_changed and use main_folder_changed to process it. (main_message_changed): Remove.d (message_list_init): Setup async event handler. (message_list_destroy): Remove async handler. (folder_changed): Use async hanler to emit event in main loop. (message_changed): Same. svn path=/trunk/; revision=13698
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index fdb6e912c7..2cb0f081c2 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -1120,6 +1120,7 @@ message_list_init (GtkObject *object)
message_list->hide_lock = g_mutex_new();
message_list->uid_nodemap = g_hash_table_new (g_str_hash, g_str_equal);
+ message_list->async_event = mail_async_event_new();
}
static void
@@ -1127,6 +1128,8 @@ message_list_destroy (GtkObject *object)
{
MessageList *message_list = MESSAGE_LIST (object);
+ mail_async_event_destroy(message_list->async_event);
+
if (message_list->folder) {
save_tree_state(message_list);
hide_save_state(message_list);
@@ -1868,9 +1871,8 @@ main_folder_changed (CamelObject *o, gpointer event_data, gpointer user_data)
static void
folder_changed (CamelObject *o, gpointer event_data, gpointer user_data)
{
- /* similarly to message_changed, copy the change list and propagate it to
- the main thread and free it */
CamelFolderChangeInfo *changes;
+ MessageList *ml = MESSAGE_LIST (user_data);
if (event_data) {
changes = camel_folder_change_info_new();
@@ -1878,29 +1880,20 @@ folder_changed (CamelObject *o, gpointer event_data, gpointer user_data)
} else {
changes = NULL;
}
- mail_proxy_event (main_folder_changed, o, changes, user_data);
+
+ mail_async_event_emit(ml->async_event, main_folder_changed, o, changes, user_data);
}
static void
-main_message_changed (CamelObject *o, gpointer uid, gpointer user_data)
+message_changed (CamelObject *o, gpointer event_data, gpointer user_data)
{
- MessageList *ml = MESSAGE_LIST (user_data);
CamelFolderChangeInfo *changes;
+ MessageList *ml = MESSAGE_LIST (user_data);
changes = camel_folder_change_info_new();
- camel_folder_change_info_change_uid(changes, uid);
- main_folder_changed(o, changes, ml);
- g_free(uid);
-}
+ camel_folder_change_info_change_uid(changes, (char *)event_data);
-static void
-message_changed (CamelObject *o, gpointer event_data, gpointer user_data)
-{
- /* Here we copy the data because our thread may free the copy that we would reference.
- * The other thread would be passed a uid parameter that pointed to freed data.
- * We copy it and free it in the handler.
- */
- mail_proxy_event (main_message_changed, o, g_strdup ((gchar *)event_data), user_data);
+ mail_async_event_emit(ml->async_event, main_folder_changed, o, changes, user_data);
}
void