From dbee806d9db60bdaf0f6e1d15b26c3ee7e2dd9db Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Thu, 4 Jun 2009 00:52:25 +0530 Subject: =?UTF-8?q?Bug=20584733=20=E2=80=93=20Cannot=20create=20new=20acco?= =?UTF-8?q?unt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Broken stuffs post, Anjal migration. --- mail/em-account-editor.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'mail') diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 0016952cff..1f0fdb8ba9 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -183,6 +183,7 @@ typedef struct _EMAccountEditorPrivate { /* for druid page preparation */ guint identity_set:1; guint receive_set:1; + guint send_set:1; guint management_set:1; } EMAccountEditorPrivate; @@ -1420,7 +1421,7 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service) current[len] = 0; } } else { - current = g_strdup("imap"); + current = "imap"; } store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); @@ -1466,7 +1467,6 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service) i++; } - gtk_cell_layout_clear((GtkCellLayout *)dropdown); gtk_combo_box_set_model(dropdown, (GtkTreeModel *)store); gtk_cell_layout_pack_start((GtkCellLayout *)dropdown, cell, TRUE); @@ -2788,28 +2788,33 @@ emae_check_complete(EConfig *ec, const gchar *pageid, gpointer data) gtk_entry_set_text(emae->priv->transport.username, user); if (uri && (url = camel_url_new(uri, NULL)) != NULL) { refresh = TRUE; - camel_url_set_protocol(url, mail_servers[index].proto); - camel_url_set_param(url, "use_ssl", mail_servers[index].ssl); - camel_url_set_host (url, mail_servers[index].recv); camel_url_set_user (url, user); - gtk_entry_set_text(emae->priv->source.hostname, mail_servers[index].recv); - gtk_entry_set_text(emae->priv->transport.hostname, mail_servers[index].send); + if (index != -1) { + camel_url_set_protocol(url, mail_servers[index].proto); + camel_url_set_param(url, "use_ssl", mail_servers[index].ssl); + camel_url_set_host (url, mail_servers[index].recv); + gtk_entry_set_text(emae->priv->source.hostname, mail_servers[index].recv); + gtk_entry_set_text(emae->priv->transport.hostname, mail_servers[index].send); + camel_url_set_host (url, mail_servers[index].recv); + + } else { + camel_url_set_host (url, ""); + } + camel_url_set_user (url, user); uri = camel_url_to_string(url, 0); e_account_set_string(emae->account, E_ACCOUNT_SOURCE_URL, uri); - g_free(uri); camel_url_free(url); - } else { - g_warning("buz1\n"); } } } else if (!strcmp(pageid, "30.send")) { + if (!emae->priv->send_set) { CamelURL *url; gchar *at, *user; gint index; gchar *uri = (gchar *)e_account_get_string(emae->account, E_ACCOUNT_TRANSPORT_URL); - + emae->priv->send_set = 1; tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_ADDRESS); at = strchr(tmp, '@'); user = g_alloca(at-tmp+1); @@ -2818,7 +2823,7 @@ emae_check_complete(EConfig *ec, const gchar *pageid, gpointer data) at++; index = check_servers(at); - if (uri && (url = camel_url_new(uri, NULL)) != NULL) { + if (index != -1 && uri && (url = camel_url_new(uri, NULL)) != NULL) { refresh = TRUE; camel_url_set_protocol (url, "smtp"); camel_url_set_param(url, "use_ssl", mail_servers[index].ssl); @@ -2828,11 +2833,9 @@ emae_check_complete(EConfig *ec, const gchar *pageid, gpointer data) e_account_set_string(emae->account, E_ACCOUNT_TRANSPORT_URL, uri); g_free(uri); camel_url_free(url); - } else { - g_warning("buz2\n"); } - + } } else if (!strcmp(pageid, "20.receive_options")) { if (emae->priv->source.provider && emae->priv->extra_provider != emae->priv->source.provider) { -- cgit v1.2.3