aboutsummaryrefslogtreecommitdiffstats
path: root/libemail-engine
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-10-25 23:05:02 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-10-26 01:01:50 +0800
commitaded0858c49c3b729564a35427e3affb514fffb9 (patch)
treefe15021104e6d8203d89a566ef519acfe52d5c67 /libemail-engine
parente7981244a68c9d0b6b93d8c2697569668098b647 (diff)
downloadgsoc2013-evolution-aded0858c49c3b729564a35427e3affb514fffb9.tar
gsoc2013-evolution-aded0858c49c3b729564a35427e3affb514fffb9.tar.gz
gsoc2013-evolution-aded0858c49c3b729564a35427e3affb514fffb9.tar.bz2
gsoc2013-evolution-aded0858c49c3b729564a35427e3affb514fffb9.tar.lz
gsoc2013-evolution-aded0858c49c3b729564a35427e3affb514fffb9.tar.xz
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')
-rw-r--r--libemail-engine/e-mail-folder-utils.c2
-rw-r--r--libemail-engine/e-mail-utils.c39
-rw-r--r--libemail-engine/e-mail-utils.h3
3 files changed, 3 insertions, 41 deletions
diff --git a/libemail-engine/e-mail-folder-utils.c b/libemail-engine/e-mail-folder-utils.c
index 971a67257f..5f9ea6a4e5 100644
--- a/libemail-engine/e-mail-folder-utils.c
+++ b/libemail-engine/e-mail-folder-utils.c
@@ -306,7 +306,7 @@ mail_folder_expunge_pop3_stores (CamelFolder *folder,
extension = e_source_get_extension (source, extension_name);
backend_name = e_source_backend_get_backend_name (extension);
- if (!em_utils_is_source_enabled_with_parents (registry, source) ||
+ if (!e_source_registry_check_enabled (registry, source) ||
g_strcmp0 (backend_name, "pop") != 0)
continue;
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
diff --git a/libemail-engine/e-mail-utils.h b/libemail-engine/e-mail-utils.h
index e7521d6e26..1844b49e36 100644
--- a/libemail-engine/e-mail-utils.h
+++ b/libemail-engine/e-mail-utils.h
@@ -62,9 +62,6 @@ ESource * em_utils_guess_mail_identity_with_recipients
ESource * em_utils_ref_mail_identity_for_store
(ESourceRegistry *registry,
CamelStore *store);
-gboolean em_utils_is_source_enabled_with_parents
- (ESourceRegistry *registry,
- ESource *source);
void emu_remove_from_mail_cache (const GSList *addresses);
void emu_remove_from_mail_cache_1 (const gchar *address);
void emu_free_mail_cache (GDestroyNotify done_cb,