aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree-model.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-01-06 02:46:02 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-01-06 02:46:02 +0800
commit2e158d6b35603cf3817a07ea70405c3687202a65 (patch)
tree56400f5683e2d44e368ed6d9e8054f899148c67a /mail/em-folder-tree-model.c
parent6c267bc56a9c5d6021c9a6d36af87804f2080e2c (diff)
downloadgsoc2013-evolution-2e158d6b35603cf3817a07ea70405c3687202a65.tar
gsoc2013-evolution-2e158d6b35603cf3817a07ea70405c3687202a65.tar.gz
gsoc2013-evolution-2e158d6b35603cf3817a07ea70405c3687202a65.tar.bz2
gsoc2013-evolution-2e158d6b35603cf3817a07ea70405c3687202a65.tar.lz
gsoc2013-evolution-2e158d6b35603cf3817a07ea70405c3687202a65.tar.xz
gsoc2013-evolution-2e158d6b35603cf3817a07ea70405c3687202a65.tar.zst
gsoc2013-evolution-2e158d6b35603cf3817a07ea70405c3687202a65.zip
If we aren't in the main thread, proxy it over to the main thread.
2004-01-05 Jeffrey Stedfast <fejj@ximian.com> * em-folder-tree-model.c (folder_subscribed_cb): If we aren't in the main thread, proxy it over to the main thread. (folder_unsubscribed_cb): Same. (folder_created_cb): Here too. (folder_deleted_cb): And here. (folder_renamed_cb): Again here. * em-folder-view.c (emfv_set_folder_uri): Pass mail_thread_queued to mail_get_folder() instead of mail_thread_new so that we eliminate a race when switching folders in the UI. svn path=/trunk/; revision=24050
Diffstat (limited to 'mail/em-folder-tree-model.c')
-rw-r--r--mail/em-folder-tree-model.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index fdbf7ab93b..118f05f28e 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -39,6 +39,7 @@
#include "mail-config.h"
#include "mail-session.h"
#include "mail-tools.h"
+#include "mail-mt.h"
#include "em-utils.h"
@@ -795,6 +796,11 @@ folder_subscribed_cb (CamelStore *store, void *event_data, EMFolderTreeModel *mo
gboolean load;
char *dirname;
+ if (pthread_self () != mail_gui_thread) {
+ mail_async_event_emit (mail_async_event, MAIL_ASYNC_GUI, (MailAsyncFunc) folder_subscribed_cb, store, event_data, model);
+ return;
+ }
+
if (!(si = g_hash_table_lookup (model->store_hash, store)))
return;
@@ -849,6 +855,11 @@ folder_unsubscribed_cb (CamelStore *store, void *event_data, EMFolderTreeModel *
GtkTreePath *path;
GtkTreeIter iter;
+ if (pthread_self () != mail_gui_thread) {
+ mail_async_event_emit (mail_async_event, MAIL_ASYNC_GUI, (MailAsyncFunc) folder_unsubscribed_cb, store, event_data, model);
+ return;
+ }
+
if (!(si = g_hash_table_lookup (model->store_hash, store)))
return;
@@ -867,6 +878,11 @@ folder_unsubscribed_cb (CamelStore *store, void *event_data, EMFolderTreeModel *
static void
folder_created_cb (CamelStore *store, void *event_data, EMFolderTreeModel *model)
{
+ if (pthread_self () != mail_gui_thread) {
+ mail_async_event_emit (mail_async_event, MAIL_ASYNC_GUI, (MailAsyncFunc) folder_created_cb, store, event_data, model);
+ return;
+ }
+
/* we only want created events to do more work if we don't support subscriptions */
if (!camel_store_supports_subscriptions (store))
folder_subscribed_cb (store, event_data, model);
@@ -875,6 +891,11 @@ folder_created_cb (CamelStore *store, void *event_data, EMFolderTreeModel *model
static void
folder_deleted_cb (CamelStore *store, void *event_data, EMFolderTreeModel *model)
{
+ if (pthread_self () != mail_gui_thread) {
+ mail_async_event_emit (mail_async_event, MAIL_ASYNC_GUI, (MailAsyncFunc) folder_deleted_cb, store, event_data, model);
+ return;
+ }
+
/* we only want deleted events to do more work if we don't support subscriptions */
if (!camel_store_supports_subscriptions (store))
folder_unsubscribed_cb (store, event_data, model);
@@ -890,6 +911,11 @@ folder_renamed_cb (CamelStore *store, void *event_data, EMFolderTreeModel *model
GtkTreePath *path;
char *parent, *p;
+ if (pthread_self () != mail_gui_thread) {
+ mail_async_event_emit (mail_async_event, MAIL_ASYNC_GUI, (MailAsyncFunc) folder_renamed_cb, store, event_data, model);
+ return;
+ }
+
if (!(si = g_hash_table_lookup (model->store_hash, store)))
return;