[evolution] Slow start due to instant saving of no change in an EAccountList



commit a4afc774381b8da813b8a615a4e5f29fabbcee7c
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jan 10 18:17:29 2012 +0100

    Slow start due to instant saving of no change in an EAccountList

 mail/e-mail-account-store.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c
index e0bd90e..e5a6308 100644
--- a/mail/e-mail-account-store.c
+++ b/mail/e-mail-account-store.c
@@ -462,6 +462,7 @@ mail_account_store_service_removed (EMailAccountStore *store,
 
 	EAccountList *account_list;
 	EAccount *account;
+	CamelProvider *provider;
 	const gchar *uid;
 
 	account_list = e_get_account_list ();
@@ -469,15 +470,15 @@ mail_account_store_service_removed (EMailAccountStore *store,
 	account = e_get_account_by_uid (uid);
 	g_return_if_fail (account != NULL);
 
-	if (account->enabled) {
-		CamelProvider *provider;
+	/* no change */
+	if (!account->enabled)
+		return;
 
-		provider = camel_service_get_provider (service);
-		g_return_if_fail (provider != NULL);
+	provider = camel_service_get_provider (service);
+	g_return_if_fail (provider != NULL);
 
-		if (provider->flags & CAMEL_PROVIDER_IS_STORAGE)
-			mail_disconnect_store (CAMEL_STORE (service));
-	}
+	if (provider->flags & CAMEL_PROVIDER_IS_STORAGE)
+		mail_disconnect_store (CAMEL_STORE (service));
 
 	/* Remove all the proxies the account has created.
 	 * FIXME This proxy stuff belongs in evolution-groupwise. */
@@ -521,6 +522,10 @@ mail_account_store_service_enabled (EMailAccountStore *store,
 		account = e_get_account_by_uid (uid);
 		g_return_if_fail (account != NULL);
 
+		/* no change */
+		if (account->enabled)
+			return;
+
 		account->enabled = TRUE;
 
 		e_account_list_change (account_list, account);
@@ -562,6 +567,10 @@ mail_account_store_service_disabled (EMailAccountStore *store,
 		account = e_get_account_by_uid (uid);
 		g_return_if_fail (account != NULL);
 
+		/* no change */
+		if (!account->enabled)
+			return;
+
 		account->enabled = FALSE;
 
 		provider = camel_service_get_provider (service);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]