[evolution/gnome-3-16] [EMailAccountStore] Unnecessary ESource writes on start
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-16] [EMailAccountStore] Unnecessary ESource writes on start
- Date: Thu, 18 Jun 2015 08:24:53 +0000 (UTC)
commit 47d673127ce4dde6c9fe069d076c645ac60b68bd
Author: Milan Crha <mcrha redhat com>
Date: Thu Jun 18 10:20:29 2015 +0200
[EMailAccountStore] Unnecessary ESource writes on start
When the ESource was disabled, then the mail account store changed
the ESource enabled state and wrote it, but the ESource could be already
disabled, thus the write was made unnecessarily.
mail/e-mail-account-store.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c
index 234f8e7..8fd06e8 100644
--- a/mail/e-mail-account-store.c
+++ b/mail/e-mail-account-store.c
@@ -606,7 +606,7 @@ mail_account_store_service_enabled (EMailAccountStore *store,
if (uid != NULL)
identity = e_source_registry_ref_source (registry, uid);
- if (identity != NULL && e_source_get_writable (identity)) {
+ if (identity != NULL && e_source_get_writable (identity) && !e_source_get_enabled (identity))
{
e_source_set_enabled (identity, TRUE);
store->priv->busy_count++;
@@ -636,7 +636,7 @@ mail_account_store_service_enabled (EMailAccountStore *store,
}
}
- if (source != NULL && e_source_get_writable (source)) {
+ if (source != NULL && e_source_get_writable (source) && !e_source_get_enabled (source)) {
e_source_set_enabled (source, TRUE);
store->priv->busy_count++;
@@ -691,7 +691,7 @@ mail_account_store_service_disabled (EMailAccountStore *store,
call_allow_auth_prompt (identity);
}
- if (identity != NULL && e_source_get_writable (identity)) {
+ if (identity != NULL && e_source_get_writable (identity) && e_source_get_enabled (identity)) {
e_source_set_enabled (identity, FALSE);
store->priv->busy_count++;
@@ -723,7 +723,7 @@ mail_account_store_service_disabled (EMailAccountStore *store,
}
}
- if (source != NULL && e_source_get_writable (source)) {
+ if (source != NULL && e_source_get_writable (source) && e_source_get_enabled (source)) {
e_source_set_enabled (source, FALSE);
store->priv->busy_count++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]