diff options
author | Jeffrey Stedfast <fejj@novell.com> | 2006-06-03 03:30:10 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2006-06-03 03:30:10 +0800 |
commit | 397b053b03f997e1029432419a03bba652bf6a60 (patch) | |
tree | d4a20e0058ce8d5d1abb723d51b25761e23a071d /mail/em-folder-view.c | |
parent | e4bdc1e6a762058e4e289d6d7710dcadda1caca1 (diff) | |
download | gsoc2013-evolution-397b053b03f997e1029432419a03bba652bf6a60.tar.gz gsoc2013-evolution-397b053b03f997e1029432419a03bba652bf6a60.tar.zst gsoc2013-evolution-397b053b03f997e1029432419a03bba652bf6a60.zip |
Can't make camel calls from the main thread or we run the risk of
2006-06-02 Jeffrey Stedfast <fejj@novell.com>
* em-folder-view.c (emfv_setup_view_instance): Can't make camel
calls from the main thread or we run the risk of deadlocking.
svn path=/trunk/; revision=32072
Diffstat (limited to 'mail/em-folder-view.c')
-rw-r--r-- | mail/em-folder-view.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index 5b002cdaa9..4c0c225393 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -497,16 +497,14 @@ emfv_list_display_view(GalViewInstance *instance, GalView *view, EMFolderView *e static void emfv_setup_view_instance(EMFolderView *emfv) { + static GalViewCollection *collection = NULL; struct _EMFolderViewPrivate *p = emfv->priv; - gboolean outgoing; + gboolean outgoing, show_wide; char *id; - static GalViewCollection *collection = NULL; - CamelFolderInfo *fi = NULL; - gboolean show_wide = gconf_client_get_bool (mail_config_get_gconf_client (), "/apps/evolution/mail/display/show_wide", NULL); g_assert(emfv->folder); g_assert(emfv->folder_uri); - + if (collection == NULL) { ETableSpecification *spec; GalViewFactory *factory; @@ -552,18 +550,16 @@ emfv_setup_view_instance(EMFolderView *emfv) g_object_unref(p->view_menus); p->view_menus = NULL; } - - outgoing = em_utils_folder_is_drafts (emfv->folder, emfv->folder_uri) - || em_utils_folder_is_sent (emfv->folder, emfv->folder_uri) - || em_utils_folder_is_outbox (emfv->folder, emfv->folder_uri); /* TODO: should this go through mail-config api? */ id = mail_config_folder_to_safe_url (emfv->folder); p->view_instance = gal_view_instance_new (collection, id); - + + show_wide = gconf_client_get_bool (mail_config_get_gconf_client (), "/apps/evolution/mail/display/show_wide", NULL); + if (show_wide) { char *safe_id, *filename; - + /* Force to use the wide view */ g_free (p->view_instance->custom_filename); g_free (p->view_instance->current_view_filename); @@ -577,21 +573,20 @@ emfv_setup_view_instance(EMFolderView *emfv) g_free (safe_id); } g_free (id); - - fi = camel_store_get_folder_info (emfv->folder->parent_store, - emfv->folder->full_name, - CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, - NULL); - if (outgoing || (fi && ((fi->flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_SENT))) { + + outgoing = em_utils_folder_is_drafts (emfv->folder, emfv->folder_uri) + || em_utils_folder_is_sent (emfv->folder, emfv->folder_uri) + || em_utils_folder_is_outbox (emfv->folder, emfv->folder_uri); + + if (outgoing) { if (show_wide) gal_view_instance_set_default_view(p->view_instance, "Wide_View_Sent"); else gal_view_instance_set_default_view(p->view_instance, "As_Sent_Folder"); - } else if (show_wide){ + } else if (show_wide) { gal_view_instance_set_default_view(p->view_instance, "Wide_View_Normal"); } - gal_view_instance_load(p->view_instance); if (!gal_view_instance_exists(p->view_instance)) { |