aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/gui/itip-utils.c6
-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
-rw-r--r--mail/em-composer-utils.c12
-rw-r--r--mail/em-utils.c3
-rw-r--r--modules/itip-formatter/itip-view.c6
-rw-r--r--widgets/misc/e-mail-identity-combo-box.c3
8 files changed, 20 insertions, 54 deletions
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index b7b31dbf48..738baa3654 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -188,7 +188,7 @@ itip_get_fallback_identity (ESourceRegistry *registry)
if (source == NULL)
return NULL;
- if (!e_source_get_enabled (source)) {
+ if (!e_source_registry_check_enabled (registry, source)) {
g_object_unref (source);
return NULL;
}
@@ -439,7 +439,7 @@ itip_get_comp_attendee (ESourceRegistry *registry,
source = E_SOURCE (link->data);
- if (!e_source_get_enabled (source))
+ if (!e_source_registry_check_enabled (registry, source))
continue;
extension_name = E_SOURCE_EXTENSION_MAIL_IDENTITY;
@@ -1583,7 +1583,7 @@ find_enabled_identity (ESourceRegistry *registry,
ESourceMailIdentity *extension;
const gchar *address;
- if (!e_source_get_enabled (source))
+ if (!e_source_registry_check_enabled (registry, source))
continue;
extension = e_source_get_extension (source, extension_name);
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,
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index b97883061b..19784351ef 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -378,7 +378,7 @@ composer_presend_check_identity (EMsgComposer *composer,
source = e_source_registry_ref_source (registry, uid);
g_return_val_if_fail (source != NULL, FALSE);
- if (!e_source_get_enabled (source)) {
+ if (!e_source_registry_check_enabled (registry, source)) {
e_alert_submit (
E_ALERT_SINK (composer),
"mail:send-no-account-enabled", NULL);
@@ -2450,8 +2450,10 @@ generate_recipient_hash (ESourceRegistry *registry)
* identities at all and so we should never get here. */
g_warn_if_fail (default_source != NULL);
- source_is_default = e_source_equal (source, default_source);
- source_is_enabled = e_source_get_enabled (source);
+ source_is_default =
+ e_source_equal (source, default_source);
+ source_is_enabled =
+ e_source_registry_check_enabled (registry, source);
extension_name = E_SOURCE_EXTENSION_MAIL_IDENTITY;
extension = e_source_get_extension (source, extension_name);
@@ -2466,8 +2468,8 @@ generate_recipient_hash (ESourceRegistry *registry)
if (cached_source != NULL) {
cached_is_default = e_source_equal (
cached_source, default_source);
- cached_is_enabled =
- e_source_get_enabled (cached_source);
+ cached_is_enabled = e_source_registry_check_enabled (
+ registry, cached_source);
} else {
cached_is_default = FALSE;
cached_is_enabled = FALSE;
diff --git a/mail/em-utils.c b/mail/em-utils.c
index f7f12e5755..80967f1f52 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1424,7 +1424,8 @@ em_utils_empty_trash (GtkWidget *parent,
source = e_source_registry_ref_source (registry, uid);
if (source != NULL) {
- enabled = e_source_get_enabled (source);
+ enabled = e_source_registry_check_enabled (
+ registry, source);
g_object_unref (source);
}
diff --git a/modules/itip-formatter/itip-view.c b/modules/itip-formatter/itip-view.c
index 7e91f3444d..0b2565cd93 100644
--- a/modules/itip-formatter/itip-view.c
+++ b/modules/itip-formatter/itip-view.c
@@ -3265,7 +3265,7 @@ find_to_address (EMailPartItip *itip_part,
const gchar *address;
gchar *text;
- if (!e_source_get_enabled (source))
+ if (!e_source_registry_check_enabled (registry, source))
continue;
extension = e_source_get_extension (source, extension_name);
@@ -3326,7 +3326,7 @@ find_to_address (EMailPartItip *itip_part,
const gchar *address;
gchar *text;
- if (!e_source_get_enabled (source))
+ if (!e_source_registry_check_enabled (registry, source))
continue;
extension = e_source_get_extension (source, extension_name);
@@ -3415,7 +3415,7 @@ find_from_address (EMailPartItip *pitip,
ESourceMailIdentity *extension;
const gchar *address;
- if (!e_source_get_enabled (source))
+ if (!e_source_registry_check_enabled (pitip->registry, source))
continue;
extension = e_source_get_extension (source, extension_name);
diff --git a/widgets/misc/e-mail-identity-combo-box.c b/widgets/misc/e-mail-identity-combo-box.c
index 465ef3502f..b76e0ee6bc 100644
--- a/widgets/misc/e-mail-identity-combo-box.c
+++ b/widgets/misc/e-mail-identity-combo-box.c
@@ -325,7 +325,8 @@ e_mail_identity_combo_box_refresh (EMailIdentityComboBox *combo_box)
const gchar *uid;
source = E_SOURCE (link->data);
- if (!e_source_get_enabled (source))
+
+ if (!e_source_registry_check_enabled (registry, source))
continue;
extension = e_source_get_extension (source, extension_name);