diff options
author | Dan Winship <danw@src.gnome.org> | 2000-11-28 10:10:55 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-11-28 10:10:55 +0800 |
commit | 26fccb498293b89b9bef804fc85436e00a4ee1cd (patch) | |
tree | 5c9406f58de500b3c592d06db453d643cdfd720a | |
parent | 2a50dfdd2898626fc5e2315742ab4022536cf7e3 (diff) | |
download | gsoc2013-evolution-26fccb498293b89b9bef804fc85436e00a4ee1cd.tar gsoc2013-evolution-26fccb498293b89b9bef804fc85436e00a4ee1cd.tar.gz gsoc2013-evolution-26fccb498293b89b9bef804fc85436e00a4ee1cd.tar.bz2 gsoc2013-evolution-26fccb498293b89b9bef804fc85436e00a4ee1cd.tar.lz gsoc2013-evolution-26fccb498293b89b9bef804fc85436e00a4ee1cd.tar.xz gsoc2013-evolution-26fccb498293b89b9bef804fc85436e00a4ee1cd.tar.zst gsoc2013-evolution-26fccb498293b89b9bef804fc85436e00a4ee1cd.zip |
This needs to run from the main thread, not the camel thread, so add a
* mail-local.c (local_folder_changed): This needs to run from the
main thread, not the camel thread, so add a proxy signal handler
to call mail_op_forward_event. Fixes hangs (eg bugzilla #909).
svn path=/trunk/; revision=6687
-rw-r--r-- | mail/ChangeLog | 6 | ||||
-rw-r--r-- | mail/mail-local.c | 21 |
2 files changed, 22 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 75fe25210f..d7b1bc3179 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2000-11-27 Dan Winship <danw@helixcode.com> + + * mail-local.c (local_folder_changed): This needs to run from the + main thread, not the camel thread, so add a proxy signal handler + to call mail_op_forward_event. Fixes hangs (eg bugzilla #909). + 2000-11-27 Jeffrey Stedfast <fejj@helixcode.com> * mail-display.c: Removed some unecessary debugging printf's diff --git a/mail/mail-local.c b/mail/mail-local.c index 6b1359e73c..666cfefbbd 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -623,12 +623,10 @@ static void local_folder_changed (CamelObject *object, gpointer event_data, gpointer user_data) { - CamelFolder *folder = CAMEL_FOLDER (object); MailLocalFolder *local_folder = user_data; - int unread; + int unread = GPOINTER_TO_INT (event_data); char *display; - unread = camel_folder_get_unread_message_count (folder); if (unread != local_folder->last_unread) { CORBA_Environment ev; @@ -652,6 +650,18 @@ local_folder_changed (CamelObject *object, gpointer event_data, } } +static void +local_folder_changed_proxy (CamelObject *object, gpointer event_data, + gpointer user_data) +{ + CamelFolder *folder = CAMEL_FOLDER (object); + int unread; + + unread = camel_folder_get_unread_message_count (folder); + mail_op_forward_event (local_folder_changed, object, + GINT_TO_POINTER (unread), user_data); +} + static char * describe_register_folder (gpointer in_data, gboolean gerund) { @@ -686,6 +696,8 @@ do_register_folder (gpointer in_data, gpointer op_data, CamelException *ex) if (meta->indexed) flags |= CAMEL_STORE_FOLDER_BODY_INDEX; local_folder->folder = camel_store_get_folder (store, meta->name, flags, ex); + local_folder->last_unread = camel_folder_get_unread_message_count ( + local_folder->folder); camel_object_unref (CAMEL_OBJECT (store)); free_metainfo (meta); } @@ -704,10 +716,9 @@ cleanup_register_folder (gpointer in_data, gpointer op_data, g_hash_table_insert (local_folder->local_store->folders, local_folder->name, local_folder->folder); local_folder->name = strrchr (local_folder->path, '/') + 1; - local_folder->last_unread = 0; camel_object_hook_event (CAMEL_OBJECT (local_folder->folder), - "folder_changed", local_folder_changed, + "folder_changed", local_folder_changed_proxy, local_folder); local_folder_changed (CAMEL_OBJECT (local_folder->folder), NULL, local_folder); |