diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-10-25 23:05:02 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-10-26 01:01:50 +0800 |
commit | aded0858c49c3b729564a35427e3affb514fffb9 (patch) | |
tree | fe15021104e6d8203d89a566ef519acfe52d5c67 /libemail-engine/e-mail-utils.c | |
parent | e7981244a68c9d0b6b93d8c2697569668098b647 (diff) | |
download | gsoc2013-evolution-aded0858c49c3b729564a35427e3affb514fffb9.tar.gz gsoc2013-evolution-aded0858c49c3b729564a35427e3affb514fffb9.tar.zst gsoc2013-evolution-aded0858c49c3b729564a35427e3affb514fffb9.zip |
Prefer e_source_registry_check_enabled().
Prefer e_source_registry_check_enabled() over e_source_get_enabled()
for most instances where we want to exclude disabled data sources.
Diffstat (limited to 'libemail-engine/e-mail-utils.c')
-rw-r--r-- | libemail-engine/e-mail-utils.c | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/libemail-engine/e-mail-utils.c b/libemail-engine/e-mail-utils.c index 8f91971866..d8a372ef5a 100644 --- a/libemail-engine/e-mail-utils.c +++ b/libemail-engine/e-mail-utils.c @@ -1064,7 +1064,7 @@ mail_account_in_recipients (ESourceRegistry *registry, gchar *address; /* Disregard disabled mail accounts. */ - if (!e_source_get_enabled (source)) + if (!e_source_registry_check_enabled (registry, source)) return FALSE; extension_name = E_SOURCE_EXTENSION_MAIL_ACCOUNT; @@ -1176,7 +1176,7 @@ second_preference: for (iter = list; iter != NULL; iter = g_list_next (iter)) { ESource *temp = E_SOURCE (iter->data); - if (em_utils_is_source_enabled_with_parents (registry, temp) && + if (e_source_registry_check_enabled (registry, temp) && mail_account_in_recipients (registry, temp, recipients)) { source = g_object_ref (temp); break; @@ -1273,41 +1273,6 @@ em_utils_ref_mail_identity_for_store (ESourceRegistry *registry, return source; } -gboolean -em_utils_is_source_enabled_with_parents (ESourceRegistry *registry, - ESource *source) -{ - ESource *parent; - const gchar *parent_uid; - - g_return_val_if_fail (registry != NULL, FALSE); - g_return_val_if_fail (source != NULL, FALSE); - - if (!e_source_get_enabled (source)) - return FALSE; - - parent = g_object_ref (source); - while (parent_uid = e_source_get_parent (parent), parent_uid) { - ESource *next = e_source_registry_ref_source (registry, parent_uid); - - if (!next) - break; - - g_object_unref (parent); - - if (!e_source_get_enabled (next)) { - g_object_unref (next); - return FALSE; - } - - parent = next; - } - - g_object_unref (parent); - - return TRUE; -} - /** * em_utils_uids_free: * @uids: array of uids |