[evolution/wip/gsettings] Don't set the URL's defaults when the providers have not been refreshed



commit b6a67769cfeb0f0d1f063477568a2084ea0b9156
Author: Federico Mena Quintero <federico novell com>
Date:   Thu Dec 2 17:55:36 2010 -0600

    Don't set the URL's defaults when the providers have not been refreshed
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 mail/em-account-editor.c |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index f2ad70f..48c564c 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -1725,18 +1725,20 @@ emae_refresh_providers (EMAccountEditor *emae, EMAccountEditorService *service)
 
 		/* find the displayed and set default */
 		if (i == 0 || (current && strcmp (provider->protocol, current) == 0)) {
+			CamelURL *url;
+
 			service->provider = provider;
 			active = i;
 
-			/* we need to set this value on the uri too */
+			url = emae_account_url (emae, info->account_uri_key);
 			if (current == NULL) {
-				CamelURL *url = emae_account_url (emae, info->account_uri_key);
-
+				/* we need to set this value on the uri too */
 				camel_url_set_protocol (url, provider->protocol);
-				set_provider_defaults_on_url (emae, provider, url);
-				emae_uri_changed (service, url);
-				camel_url_free (url);
 			}
+
+			set_provider_defaults_on_url (emae, provider, url);
+			emae_uri_changed (service, url);
+			camel_url_free (url);
 		}
 		i++;
 	}
@@ -3470,10 +3472,6 @@ emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data)
 						camel_url_set_user (url, user);
 					if (sdata != NULL) {
 						camel_url_set_protocol (url, sdata->proto);
-
-						if (emae->priv->source.provider)
-							set_provider_defaults_on_url (emae, emae->priv->source.provider, url);
-
 						if (sdata->recv_sock && *sdata->recv_sock)
 							camel_url_set_param (url, "use_ssl", sdata->recv_sock);
 						else
@@ -3516,10 +3514,6 @@ emae_check_complete (EConfig *ec, const gchar *pageid, gpointer data)
 				if (sdata != NULL && uri && (url = camel_url_new (uri, NULL)) != NULL) {
 					refresh = TRUE;
 					camel_url_set_protocol (url, "smtp");
-
-					if (emae->priv->source.provider)
-						set_provider_defaults_on_url (emae, emae->priv->source.provider, url);
-
 					if (sdata->send_sock && *sdata->send_sock)
 						camel_url_set_param (url, "use_ssl", sdata->send_sock);
 					else



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