diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-06-09 01:18:04 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-06-09 01:47:22 +0800 |
commit | b4fbbde6ab7deb247f1db19558489a868c75467d (patch) | |
tree | d8dd0d1950cf35719391ec60474e5fa0844e1165 /mail/e-mail-account-store.c | |
parent | f92f3a1f453b037427539f2c0e3968d56fde8696 (diff) | |
download | gsoc2013-evolution-b4fbbde6ab7deb247f1db19558489a868c75467d.tar gsoc2013-evolution-b4fbbde6ab7deb247f1db19558489a868c75467d.tar.gz gsoc2013-evolution-b4fbbde6ab7deb247f1db19558489a868c75467d.tar.bz2 gsoc2013-evolution-b4fbbde6ab7deb247f1db19558489a868c75467d.tar.lz gsoc2013-evolution-b4fbbde6ab7deb247f1db19558489a868c75467d.tar.xz gsoc2013-evolution-b4fbbde6ab7deb247f1db19558489a868c75467d.tar.zst gsoc2013-evolution-b4fbbde6ab7deb247f1db19558489a868c75467d.zip |
Remove "enable-local" and "enable-vfolders" GSettings key.
We have built-in ESources for the 'local' and 'vfolder' mail stores,
and can now track their enabled state as we would any other mail store.
Diffstat (limited to 'mail/e-mail-account-store.c')
-rw-r--r-- | mail/e-mail-account-store.c | 63 |
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. |