diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-06-08 00:25:05 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-06-08 01:48:19 +0800 |
commit | cad21a7450e8d88032038f2592abf0d95ae5139b (patch) | |
tree | 743741e367ec06d2263b5c81beb76be8dd17c508 /mail/e-mail-account-store.c | |
parent | 75b7e16821f78f4163c0fa9655075fc57853960e (diff) | |
download | gsoc2013-evolution-cad21a7450e8d88032038f2592abf0d95ae5139b.tar gsoc2013-evolution-cad21a7450e8d88032038f2592abf0d95ae5139b.tar.gz gsoc2013-evolution-cad21a7450e8d88032038f2592abf0d95ae5139b.tar.bz2 gsoc2013-evolution-cad21a7450e8d88032038f2592abf0d95ae5139b.tar.lz gsoc2013-evolution-cad21a7450e8d88032038f2592abf0d95ae5139b.tar.xz gsoc2013-evolution-cad21a7450e8d88032038f2592abf0d95ae5139b.tar.zst gsoc2013-evolution-cad21a7450e8d88032038f2592abf0d95ae5139b.zip |
EMailAccountStore: Check for a collection when adding a service.
If the mail account is part of a collection of sources, we want to read
the enabled state from the top-level "collection" source instead of the
mail account source.
Addendum: Same deal in mail_ui_session_source_changed_cb().
Diffstat (limited to 'mail/e-mail-account-store.c')
-rw-r--r-- | mail/e-mail-account-store.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c index d344d5c60d..9dde7561c5 100644 --- a/mail/e-mail-account-store.c +++ b/mail/e-mail-account-store.c @@ -1061,6 +1061,7 @@ e_mail_account_store_add_service (EMailAccountStore *store, } else { EMailSession *session; ESourceRegistry *registry; + ESourceCollection *collection; ESource *source; session = e_mail_account_store_get_session (store); @@ -1069,6 +1070,17 @@ e_mail_account_store_add_service (EMailAccountStore *store, 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); |