aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-account-store.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/e-mail-account-store.c')
-rw-r--r--mail/e-mail-account-store.c63
1 files changed, 23 insertions, 40 deletions
diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c
index ccb122961b..630810acaa 100644
--- a/mail/e-mail-account-store.c
+++ b/mail/e-mail-account-store.c
@@ -1090,7 +1090,10 @@ void
e_mail_account_store_add_service (EMailAccountStore *store,
CamelService *service)
{
- GSettings *settings;
+ EMailSession *session;
+ ESourceRegistry *registry;
+ ESource *collection;
+ ESource *source;
GtkTreeIter iter;
const gchar *filename;
const gchar *uid;
@@ -1106,51 +1109,31 @@ e_mail_account_store_add_service (EMailAccountStore *store,
uid = camel_service_get_uid (service);
- /* Handle built-in services that don't have an EAccount. */
-
- if (g_strcmp0 (uid, E_MAIL_SESSION_LOCAL_UID) == 0) {
- builtin = TRUE;
-
- settings = g_settings_new ("org.gnome.evolution.mail");
- enabled = g_settings_get_boolean (settings, "enable-local");
- g_object_unref (settings);
-
- } else if (g_strcmp0 (uid, E_MAIL_SESSION_VFOLDER_UID) == 0) {
- builtin = TRUE;
+ builtin =
+ (g_strcmp0 (uid, E_MAIL_SESSION_LOCAL_UID) == 0) ||
+ (g_strcmp0 (uid, E_MAIL_SESSION_VFOLDER_UID) == 0);
- settings = g_settings_new ("org.gnome.evolution.mail");
- enabled = g_settings_get_boolean (settings, "enable-vfolders");
- g_object_unref (settings);
+ session = e_mail_account_store_get_session (store);
+ registry = e_mail_session_get_registry (session);
+ source = e_source_registry_ref_source (registry, uid);
+ g_return_if_fail (source != NULL);
+
+ /* If this ESource is part of a collection, we need to
+ * pick up the enabled state for the entire collection.
+ * Check the ESource and its ancestors for a collection
+ * extension and read from the containing source. */
+ collection = e_source_registry_find_extension (
+ registry, source, E_SOURCE_EXTENSION_COLLECTION);
+ if (collection != NULL) {
+ enabled = e_source_get_enabled (collection);
+ g_object_unref (collection);
} else {
- EMailSession *session;
- ESourceRegistry *registry;
- ESource *collection;
- ESource *source;
-
- session = e_mail_account_store_get_session (store);
-
- registry = e_mail_session_get_registry (session);
- source = e_source_registry_ref_source (registry, uid);
- g_return_if_fail (source != NULL);
-
- /* If this ESource is part of a collection, we need to
- * pick up the enabled state for the entire collection.
- * Check the ESource and its ancestors for a collection
- * extension and read from the containing source. */
- collection = e_source_registry_find_extension (
- registry, source, E_SOURCE_EXTENSION_COLLECTION);
- if (collection != NULL) {
- g_object_unref (source);
- source = collection;
- }
-
- builtin = FALSE;
enabled = e_source_get_enabled (source);
-
- g_object_unref (source);
}
+ g_object_unref (source);
+
/* Where do we insert new services now that accounts can be
* reordered? This is just a simple policy I came up with.
* It's certainly subject to debate and tweaking.