diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-08-18 11:10:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-08-18 11:31:01 +0800 |
commit | 31a00721343016518b458aae5c2045b32785256f (patch) | |
tree | b9d07aafab9819cfca12596cce30148ff377e642 /mail/em-folder-tree-model.c | |
parent | ef929f26973d8d5712a6962c804b1dc0b439d0a9 (diff) | |
download | gsoc2013-evolution-31a00721343016518b458aae5c2045b32785256f.tar.gz gsoc2013-evolution-31a00721343016518b458aae5c2045b32785256f.tar.zst gsoc2013-evolution-31a00721343016518b458aae5c2045b32785256f.zip |
Bug 656720 - Exclude NNTP stores from Create Folder dialog
Diffstat (limited to 'mail/em-folder-tree-model.c')
-rw-r--r-- | mail/em-folder-tree-model.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index 295d9d0865..1b79ca9ac6 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -205,7 +205,6 @@ account_changed_cb (EAccountList *accounts, EMFolderTreeModel *model) { EMailSession *session; - CamelProvider *provider; CamelService *service; session = em_folder_tree_model_get_session (model); @@ -222,12 +221,6 @@ account_changed_cb (EAccountList *accounts, if (!account->enabled) return; - /* make sure the new store belongs in the tree */ - provider = camel_service_get_provider (service); - if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE) || - em_utils_is_local_delivery_mbox_file (camel_service_get_camel_url (service))) - return; - em_folder_tree_model_add_store (model, CAMEL_STORE (service)); } @@ -1012,6 +1005,7 @@ em_folder_tree_model_add_store (EMFolderTreeModel *model, GtkTreeIter root, iter; GtkTreePath *path; CamelService *service; + CamelProvider *provider; CamelURL *service_url; const gchar *display_name; gchar *uri; @@ -1021,14 +1015,26 @@ em_folder_tree_model_add_store (EMFolderTreeModel *model, tree_store = GTK_TREE_STORE (model); - si = em_folder_tree_model_lookup_store_info (model, store); - if (si != NULL) - em_folder_tree_model_remove_store (model, store); - service = CAMEL_SERVICE (store); + provider = camel_service_get_provider (service); service_url = camel_service_get_camel_url (service); display_name = camel_service_get_display_name (service); + /* Ignore stores that should not be added to the tree model. */ + + if (provider == NULL) + return; + + if ((provider->flags & CAMEL_PROVIDER_IS_STORAGE) == 0) + return; + + if (em_utils_is_local_delivery_mbox_file (service_url)) + return; + + si = em_folder_tree_model_lookup_store_info (model, store); + if (si != NULL) + em_folder_tree_model_remove_store (model, store); + uri = camel_url_to_string (service_url, CAMEL_URL_HIDE_ALL); /* Add the store to the tree. */ |