diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-08-18 11:10:41 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-09-14 20:08:51 +0800 |
commit | 40875ac66f4ef93be31318425e89a6642d5cf0db (patch) | |
tree | 2ee2169299c8fc781b578bfa807ace36407a6e21 /mail/em-folder-utils.c | |
parent | 34be64ac5286f0a3e4c02a74ff0ef8c4062bb966 (diff) | |
download | gsoc2013-evolution-40875ac66f4ef93be31318425e89a6642d5cf0db.tar gsoc2013-evolution-40875ac66f4ef93be31318425e89a6642d5cf0db.tar.gz gsoc2013-evolution-40875ac66f4ef93be31318425e89a6642d5cf0db.tar.bz2 gsoc2013-evolution-40875ac66f4ef93be31318425e89a6642d5cf0db.tar.lz gsoc2013-evolution-40875ac66f4ef93be31318425e89a6642d5cf0db.tar.xz gsoc2013-evolution-40875ac66f4ef93be31318425e89a6642d5cf0db.tar.zst gsoc2013-evolution-40875ac66f4ef93be31318425e89a6642d5cf0db.zip |
Bug 656720 - Exclude NNTP stores from Create Folder dialog
Diffstat (limited to 'mail/em-folder-utils.c')
-rw-r--r-- | mail/em-folder-utils.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c index 1ac8b33fd2..346bd978a1 100644 --- a/mail/em-folder-utils.c +++ b/mail/em-folder-utils.c @@ -553,20 +553,44 @@ em_folder_utils_create_folder (GtkWindow *parent, CamelStore *store = NULL; gchar *folder_name = NULL; GtkWidget *dialog; + GList *list, *link; GError *error = NULL; g_return_if_fail (GTK_IS_WINDOW (parent)); g_return_if_fail (E_IS_MAIL_BACKEND (backend)); + model = em_folder_tree_model_new (); session = e_mail_backend_get_session (backend); + em_folder_tree_model_set_session (model, session); - model = em_folder_tree_model_get_default (); + list = camel_session_list_services (CAMEL_SESSION (session)); + + for (link = list; link != NULL; link = g_list_next (link)) { + CamelService *service; + CamelStore *store; + + service = CAMEL_SERVICE (link->data); + + if (!CAMEL_IS_STORE (service)) + continue; + + store = CAMEL_STORE (service); + + if ((store->flags & CAMEL_STORE_CAN_EDIT_FOLDERS) == 0) + continue; + + em_folder_tree_model_add_store (model, store); + } + + g_list_free (list); dialog = em_folder_selector_create_new ( parent, backend, model, 0, _("Create Folder"), _("Specify where to create the folder:")); + g_object_unref (model); + selector = EM_FOLDER_SELECTOR (dialog); folder_tree = em_folder_selector_get_folder_tree (selector); |