aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-utils.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-12-20 11:27:39 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-12-20 11:27:39 +0800
commit987fb91d5ec4b61d1283acdb9cf02960cc47b74d (patch)
tree5e9dc4fa1e10995f0217b068daff2ca6b77cf461 /mail/em-folder-utils.c
parentda67edd2a675481fb90b8f5fcbeb3eaf5dc427ea (diff)
downloadgsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.gz
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.bz2
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.lz
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.xz
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.tar.zst
gsoc2013-evolution-987fb91d5ec4b61d1283acdb9cf02960cc47b74d.zip
Reduce diff noise with account-mgmt branch.
Diffstat (limited to 'mail/em-folder-utils.c')
-rw-r--r--mail/em-folder-utils.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c
index aa2500cb7c..825e6af7ca 100644
--- a/mail/em-folder-utils.c
+++ b/mail/em-folder-utils.c
@@ -42,7 +42,6 @@
#include "e-util/e-mktemp.h"
#include "e-util/e-alert-dialog.h"
-#include "e-util/e-account-utils.h"
#include "em-vfolder-rule.h"
@@ -552,10 +551,11 @@ em_folder_utils_create_folder (GtkWindow *parent,
EMFolderSelector *selector;
EMFolderTree *folder_tree;
EMFolderTreeModel *model;
+ EMailAccountStore *account_store;
CamelStore *store = NULL;
gchar *folder_name = NULL;
GtkWidget *dialog;
- GList *list, *link;
+ GQueue queue = G_QUEUE_INIT;
GError *error = NULL;
g_return_if_fail (GTK_IS_WINDOW (parent));
@@ -567,22 +567,19 @@ em_folder_utils_create_folder (GtkWindow *parent,
model = em_folder_tree_model_new ();
em_folder_tree_model_set_session (model, session);
- list = camel_session_list_services (CAMEL_SESSION (session));
+ account_store = e_mail_session_get_account_store (session);
+ e_mail_account_store_queue_enabled_services (account_store, &queue);
- for (link = list; link != NULL; link = g_list_next (link)) {
+ while (!g_queue_is_empty (&queue)) {
CamelService *service;
- CamelStore *store;
- EAccount *account;
+ CamelStoreFlags flags;
const gchar *uid, *prop = NULL;
- service = CAMEL_SERVICE (link->data);
+ service = g_queue_pop_head (&queue);
+ g_warn_if_fail (CAMEL_IS_STORE (service));
- if (!CAMEL_IS_STORE (service))
- continue;
-
- store = CAMEL_STORE (service);
-
- if ((store->flags & CAMEL_STORE_CAN_EDIT_FOLDERS) == 0)
+ flags = CAMEL_STORE (service)->flags;
+ if ((flags & CAMEL_STORE_CAN_EDIT_FOLDERS) == 0)
continue;
uid = camel_service_get_uid (service);
@@ -594,15 +591,9 @@ em_folder_utils_create_folder (GtkWindow *parent,
if (prop && !e_shell_settings_get_boolean (shell_settings, prop))
continue;
- account = e_get_account_by_uid (uid);
- if (account && !account->enabled)
- continue;
-
- em_folder_tree_model_add_store (model, store);
+ em_folder_tree_model_add_store (model, CAMEL_STORE (service));
}
- g_list_free (list);
-
dialog = em_folder_selector_create_new (
parent, model, 0,
_("Create Folder"),