From 6d70e07d0842496327e1ca74f93047693ddc545c Mon Sep 17 00:00:00 2001
From: Srinivasa Ragavan <sragavan@novell.com>
Date: Fri, 22 May 2009 17:30:14 +0530
Subject: Mail changes required for Anjal.

---
 mail/em-account-editor.c | 200 ++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 180 insertions(+), 20 deletions(-)

(limited to 'mail/em-account-editor.c')

diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index b9850bd052..991add424d 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -276,6 +276,26 @@ EMAccountEditor *em_account_editor_new(EAccount *account, em_account_editor_t ty
 	return emae;
 }
 
+/**
+ * em_account_editor_new_for_pages:
+ * @account:
+ * @type:
+ *
+ * Create a new account editor.  If @account is NULL then this is to
+ * create a new account, else @account is copied to a working
+ * structure and is for editing an existing account.
+ *
+ * Return value:
+ **/
+EMAccountEditor *em_account_editor_new_for_pages(EAccount *account, em_account_editor_t type, char *id, GtkWidget **pages)
+{
+	EMAccountEditor *emae = g_object_new(em_account_editor_get_type(), NULL);
+	emae->pages = pages;
+	em_account_editor_construct(emae, account, type, id);
+
+	return emae;
+}
+
 /* ********************************************************************** */
 
 static struct {
@@ -401,7 +421,7 @@ emae_display_license(EMAccountEditor *emae, CamelProvider *prov)
 		gtk_text_view_set_editable((GtkTextView *)w, FALSE);
 		response = gtk_dialog_run((GtkDialog *)dialog);
 	} else {
-		e_error_run((GtkWindow *)gtk_widget_get_toplevel(emae->editor),
+		e_error_run(emae->editor ? (GtkWindow *)gtk_widget_get_toplevel(emae->editor) : NULL,
 			    "mail:no-load-license", prov->license_file, NULL);
 	}
 
@@ -1018,7 +1038,8 @@ emae_url_set_hostport(CamelURL *url, const char *txt)
 	}
 
 	g_strstrip(host);
-	camel_url_set_host(url, host);
+	if (txt && *txt)
+		camel_url_set_host(url, host);
 
 	g_free(host);
 }
@@ -1381,7 +1402,8 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
 	int active = 0, i;
 	struct _service_info *info = &emae_service_info[service->type];
 	const char *uri = e_account_get_string(account, info->account_uri_key);
-	char *current = NULL;
+	char *current = NULL, *tmp;
+	CamelURL *url;
 
 	dropdown = service->providers;
 	gtk_widget_show((GtkWidget *)dropdown);
@@ -1396,8 +1418,10 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
 			memcpy(current, uri, len);
 			current[len] = 0;
 		}
+	} else {
+		current = g_strdup("imap");
 	}
-
+	
 	store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
 
 	i = 0;
@@ -1423,7 +1447,7 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
 
 		gtk_list_store_append(store, &iter);
 		gtk_list_store_set(store, &iter, 0, provider->name, 1, provider, -1);
-
+		
 		/* find the displayed and set default */
 		if (i == 0 || (current && strcmp(provider->protocol, current) == 0)) {
 			service->provider = provider;
@@ -1441,13 +1465,30 @@ 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);
 	gtk_cell_layout_set_attributes((GtkCellLayout *)dropdown, cell, "text", 0, NULL);
 
+	g_signal_handlers_disconnect_by_func(dropdown, emae_provider_changed, service);
 	gtk_combo_box_set_active(dropdown, -1);	/* needed for gtkcombo bug(?) */
 	gtk_combo_box_set_active(dropdown, active);
 	g_signal_connect(dropdown, "changed", G_CALLBACK(emae_provider_changed), service);
+
+	if (!uri  || (url = camel_url_new(uri, NULL)) == NULL) {
+		return;
+	}
+	
+	tmp = (char *)camel_url_get_param(url, "use_ssl");
+	if (tmp == NULL)
+		tmp = "never";	
+	for (i=0;i<num_ssl_options;i++) {
+		if (!strcmp(ssl_options[i].value, tmp)) {
+			gtk_combo_box_set_active(service->use_ssl, i);
+			break;
+		}
+	}
 }
 
 static void
@@ -1603,11 +1644,12 @@ static void emae_check_authtype(GtkWidget *w, EMAccountEditorService *service)
 	uri = e_account_get_string(emae->account, emae_service_info[service->type].account_uri_key);
 	g_object_ref(emae);
 
-	service->check_dialog = e_error_new((GtkWindow *)gtk_widget_get_toplevel(emae->editor),
+	service->check_dialog = e_error_new(emae->editor ? (GtkWindow *)gtk_widget_get_toplevel(emae->editor) : NULL,
 					    "mail:checking-service", NULL);
 	g_signal_connect(service->check_dialog, "response", G_CALLBACK(emae_check_authtype_response), service);
 	gtk_widget_show(service->check_dialog);
-	gtk_widget_set_sensitive(emae->editor, FALSE);
+	if (emae->editor)
+		gtk_widget_set_sensitive(emae->editor, FALSE);
 	service->check_id = mail_check_service(uri, service->type, emae_check_authtype_done, service);
 }
 
@@ -1621,7 +1663,6 @@ emae_setup_service(EMAccountEditor *emae, EMAccountEditorService *service, Glade
 	int i;
 
 	service->provider = uri?camel_provider_get(uri, NULL):NULL;
-
 	service->frame = glade_xml_get_widget(xml, info->frame);
 	service->container = glade_xml_get_widget(xml, info->container);
 	service->description = GTK_LABEL (glade_xml_get_widget (xml, info->description));
@@ -1650,8 +1691,9 @@ emae_setup_service(EMAccountEditor *emae, EMAccountEditorService *service, Glade
 		} else
 			gtk_entry_set_text(service->hostname, url->host);
 	}
-	if (url->user)
+	if (url->user && *url->user) {
 		gtk_entry_set_text(service->username, url->user);
+	}
 	if (service->pathentry) {
 		GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
 
@@ -1789,7 +1831,9 @@ emae_identity_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, st
 	}
 
 	w = glade_xml_get_widget(xml, item->label);
-	if (((EConfig *)gui->config)->type == E_CONFIG_DRUID) {
+	if (emae->type == EMAE_PAGES) {
+		gtk_box_pack_start ((GtkBox *)emae->pages[0], w, TRUE, TRUE, 0);
+	} else if (((EConfig *)gui->config)->type == E_CONFIG_DRUID) {
 		GladeXML *druidxml;
 		GtkWidget *page;
 
@@ -1838,7 +1882,9 @@ emae_receive_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str
 	emae_setup_service(emae, &gui->source, xml);
 
 	w = glade_xml_get_widget(xml, item->label);
-	if (((EConfig *)gui->config)->type == E_CONFIG_DRUID) {
+	if (emae->type == EMAE_PAGES) {
+		gtk_box_pack_start ((GtkBox *)emae->pages[1], w, TRUE, TRUE, 0);
+	} else if (((EConfig *)gui->config)->type == E_CONFIG_DRUID) {
 		GladeXML *druidxml;
 		GtkWidget *page;
 
@@ -2306,7 +2352,9 @@ emae_send_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct
 	emae_setup_service(emae, &gui->transport, xml);
 
 	w = glade_xml_get_widget(xml, item->label);
-	if (((EConfig *)gui->config)->type == E_CONFIG_DRUID) {
+	if (emae->type == EMAE_PAGES) {
+		gtk_box_pack_start ((GtkBox *)emae->pages[2], w, TRUE, TRUE, 0);
+	} else if (((EConfig *)gui->config)->type == E_CONFIG_DRUID) {
 		GladeXML *druidxml;
 		GtkWidget *page;
 
@@ -2321,7 +2369,7 @@ emae_send_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct
 		gtk_box_pack_start((GtkBox*)((GnomeDruidPageStandard *)page)->vbox, w, TRUE, TRUE, 0);
 		w = page;
 		g_object_unref(druidxml);
-		gnome_druid_append_page((GnomeDruid *)parent, (GnomeDruidPage *)page);
+		gnome_druid_append_page((GnomeDruid *)parent, (GnomeDruidPage *)page);	
 	} else {
 		gtk_notebook_append_page((GtkNotebook *)parent, w, gtk_label_new(_("Sending Email")));
 	}
@@ -2542,6 +2590,10 @@ emae_widget_druid_glade(EConfig *ec, EConfigItem *item, struct _GtkWidget *paren
 	GladeXML *druidxml;
 	GtkWidget *w;
 	char *gladefile;
+	EMAccountEditor *emae = (EMAccountEditor *)data;
+
+	if (emae->type == EMAE_PAGES)
+		return NULL;
 
 	gladefile = g_build_filename (EVOLUTION_GLADEDIR,
 				      "mail-config.glade",
@@ -2631,10 +2683,12 @@ emae_service_complete(EMAccountEditor *emae, EMAccountEditorService *service)
 	if (uri == NULL || (url = camel_url_new(uri, NULL)) == NULL)
 		return FALSE;
 
-	if (CAMEL_PROVIDER_NEEDS(service->provider, CAMEL_URL_PART_HOST)
-	    && (url->host == NULL || url->host[0] == 0))
-		ok = FALSE;
-
+	if (CAMEL_PROVIDER_NEEDS(service->provider, CAMEL_URL_PART_HOST)) {
+		if (url->host == NULL || url->host[0] == 0)
+			ok = FALSE;
+		else 
+			gtk_entry_set_text(service->hostname, url->host);
+	}
 	/* We only need the user if the service needs auth as well, i think */
 	if (ok
 	    && (service->needs_auth == NULL
@@ -2654,6 +2708,37 @@ emae_service_complete(EMAccountEditor *emae, EMAccountEditorService *service)
 	return ok;
 }
 
+enum {
+	GMAIL = 0,
+	YAHOO,
+	AOL
+};
+struct _server_prefill {
+	char *key;
+	char *recv;
+	char *send;
+	char *proto;
+	char *ssl;
+} mail_servers [] = {
+	{"gmail", "imap.gmail.com", "smtp.gmail.com", "imap", "always"},
+	{"yahoo", "pop3.yahoo.com", "smtp.yahoo.com", "pop", "never"},
+	{"aol", "imap.aol.com", "smtp.aol.com", "pop", "never"},
+	{"msn", "pop3.email.msn.com", "smtp.email.msn.com", "pop", "never"}
+};
+
+static int
+check_servers (char *server)
+{
+	int len = G_N_ELEMENTS(mail_servers), i;
+
+	for (i=0; i<len; i++) {
+		if (strstr(server, mail_servers[i].key) != NULL)
+			return i;
+	}
+
+	return -1;
+}
+
 static gboolean
 emae_check_complete(EConfig *ec, const char *pageid, void *data)
 {
@@ -2661,6 +2746,7 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
 	int ok = TRUE;
 	const char *tmp;
 	EAccount *ea;
+	gboolean refresh = FALSE;
 
 	/* We use the page-check of various pages to 'prepare' or
 	   pre-load their values, only in the druid */
@@ -2684,16 +2770,68 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
 		} else if (!strcmp(pageid, "10.receive")) {
 			if (!emae->priv->receive_set) {
 				char *user, *at;
+				int index;
+				char *uri = (char *)e_account_get_string(emae->account, E_ACCOUNT_SOURCE_URL);
+				CamelURL *url;
 
 				emae->priv->receive_set = 1;
-				tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_ADDRESS);
+				tmp = (char *)e_account_get_string(emae->account, E_ACCOUNT_ID_ADDRESS);
 				at = strchr(tmp, '@');
 				user = g_alloca(at-tmp+1);
 				memcpy(user, tmp, at-tmp);
 				user[at-tmp] = 0;
+				at++;
+
+				index = check_servers(at);
 				gtk_entry_set_text(emae->priv->source.username, user);
 				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);
+					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")) {
+				CamelURL *url;
+				char *at, *user;
+				int index;
+				char *uri = (char *)e_account_get_string(emae->account, E_ACCOUNT_TRANSPORT_URL);
+				
+				tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_ADDRESS);
+				at = strchr(tmp, '@');
+				user = g_alloca(at-tmp+1);
+				memcpy(user, tmp, at-tmp);
+				user[at-tmp] = 0;
+				at++;
+
+				index = check_servers(at);
+				if (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);
+					camel_url_set_host (url, mail_servers[index].send);
+					camel_url_set_user (url, user);
+					uri = camel_url_to_string(url, 0);
+					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) {
@@ -2740,12 +2878,18 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
 	}
 
 	if (ok && (pageid == NULL || !strcmp(pageid, "10.receive"))) {
+		if (emae->type == EMAE_PAGES && refresh) {
+			emae_refresh_providers(emae, &emae->priv->source);
+		}
 		ok = emae_service_complete(emae, &emae->priv->source);
 		if (!ok)
 			d(printf("receive page incomplete\n"));
 	}
 
 	if (ok && (pageid == NULL || !strcmp(pageid, "30.send"))) {
+		if (emae->type == EMAE_PAGES && refresh) {
+			emae_refresh_providers(emae, &emae->priv->transport);
+		}
 		ok = emae_service_complete(emae, &emae->priv->transport);
 		if (!ok)
 			d(printf("send page incomplete\n"));
@@ -2763,6 +2907,12 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
 	return ok;
 }
 
+void
+em_account_editor_check (EMAccountEditor *emae, const char *page)
+{
+	emae_check_complete((EConfig *)emae->config, page, emae);
+}
+
 /* HACK: FIXME: the component should listen to the account object directly */
 static void
 add_new_store (char *uri, CamelStore *store, void *user_data)
@@ -2809,6 +2959,12 @@ emae_commit(EConfig *ec, GSList *items, void *data)
 	e_account_list_save(accounts);
 }
 
+void
+em_account_editor_commit (EMAccountEditor *emae)
+{
+	emae_commit ((EConfig *)emae->config, NULL, emae);
+}
+
 static void
 emae_editor_destroyed(GtkWidget *dialog, EMAccountEditor *emae)
 {
@@ -2928,7 +3084,11 @@ em_account_editor_construct(EMAccountEditor *emae, EAccount *account, em_account
 
 	target = em_config_target_new_account(ec, emae->account);
 	e_config_set_target((EConfig *)ec, (EConfigTarget *)target);
-	emae->editor = e_config_create_window((EConfig *)ec, NULL, type==EMAE_NOTEBOOK?_("Account Editor"):_("Evolution Account Assistant"));
 
-	g_signal_connect(emae->editor, "destroy", G_CALLBACK(emae_editor_destroyed), emae);
+	if (type != EMAE_PAGES) {
+		emae->editor = e_config_create_window((EConfig *)ec, NULL, type==EMAE_NOTEBOOK?_("Account Editor"):_("Evolution Account Assistant"));
+		g_signal_connect(emae->editor, "destroy", G_CALLBACK(emae_editor_destroyed), emae);
+	} else {
+		e_config_create_widget((EConfig *)ec);
+	} 
 }
-- 
cgit 


From 0cf607076dfc2c481ca1164a04cecdb0661e6bd0 Mon Sep 17 00:00:00 2001
From: Matthew Barnes <mbarnes@redhat.com>
Date: Tue, 26 May 2009 10:58:25 -0400
Subject: Fix compiler warnings in mail.

---
 mail/em-account-editor.c | 185 ++++++++++++++++++++++++-----------------------
 1 file changed, 95 insertions(+), 90 deletions(-)

(limited to 'mail/em-account-editor.c')

diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 991add424d..fc61cdc84b 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -187,7 +187,7 @@ typedef struct _EMAccountEditorPrivate {
 } EMAccountEditorPrivate;
 
 static void emae_refresh_authtype(EMAccountEditor *emae, EMAccountEditorService *service);
-static void em_account_editor_construct(EMAccountEditor *emae, EAccount *account, em_account_editor_t type, char *id);
+static void em_account_editor_construct(EMAccountEditor *emae, EAccount *account, em_account_editor_t type, const gchar *id);
 static void emae_account_folder_changed(EMFolderSelectionButton *folder, EMAccountEditor *emae);
 static GtkVBoxClass *emae_parent;
 
@@ -267,7 +267,7 @@ em_account_editor_get_type(void)
  *
  * Return value:
  **/
-EMAccountEditor *em_account_editor_new(EAccount *account, em_account_editor_t type, char *id)
+EMAccountEditor *em_account_editor_new(EAccount *account, em_account_editor_t type, const gchar *id)
 {
 	EMAccountEditor *emae = g_object_new(em_account_editor_get_type(), NULL);
 
@@ -299,8 +299,8 @@ EMAccountEditor *em_account_editor_new_for_pages(EAccount *account, em_account_e
 /* ********************************************************************** */
 
 static struct {
-	char *label;
-	char *value;
+	const gchar *label;
+	const gchar *value;
 } ssl_options[] = {
 	/* Translators: This string is a "Use secure connection" option for
 	   the Mailer. It will not use an encrypted connection. */
@@ -774,7 +774,7 @@ emae_setup_receipt_policy (EMAccountEditor *emae, GladeXML *xml)
 	EAccountReceiptPolicy current = emae->account->receipt_policy;
 	static struct {
 		EAccountReceiptPolicy policy;
-		char *label;
+		const gchar *label;
 	} receipt_policies[] = {
 		{ E_ACCOUNT_RECEIPT_NEVER,  N_("Never") },
 		{ E_ACCOUNT_RECEIPT_ALWAYS, N_("Always") },
@@ -1072,34 +1072,34 @@ static struct _provider_host_info emae_transport_host_info[] = {
    i.e. the receiving (source) service, and the sending (transport) service.
    It is used throughout the following code to drive each page */
 static struct _service_info {
-	int account_uri_key;
-	int save_passwd_key;
+	gint account_uri_key;
+	gint save_passwd_key;
 
-	char *frame;
-	char *type_dropdown;
+	const gchar *frame;
+	const gchar *type_dropdown;
 
-	char *container;
-	char *description;
-	char *hostname;
-	char *hostlabel;
-	char *username;
-	char *userlabel;
-	char *path;
-	char *pathlabel;
-	char *pathentry;
+	const gchar *container;
+	const gchar *description;
+	const gchar *hostname;
+	const gchar *hostlabel;
+	const gchar *username;
+	const gchar *userlabel;
+	const gchar *path;
+	const gchar *pathlabel;
+	const gchar *pathentry;
 
-	char *security_frame;
-	char *ssl_hbox;
-	char *use_ssl;
-	char *ssl_disabled;
+	const gchar *security_frame;
+	const gchar *ssl_hbox;
+	const gchar *use_ssl;
+	const gchar *ssl_disabled;
 
-	char *needs_auth;
-	char *auth_frame;
+	const gchar *needs_auth;
+	const gchar *auth_frame;
 
-	char *authtype;
-	char *authtype_check;
+	const gchar *authtype;
+	const gchar *authtype_check;
 
-	char *remember_password;
+	const gchar *remember_password;
 
 	struct _provider_host_info *host_info;
 } emae_service_info[CAMEL_NUM_PROVIDER_TYPES] = {
@@ -1402,7 +1402,8 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
 	int active = 0, i;
 	struct _service_info *info = &emae_service_info[service->type];
 	const char *uri = e_account_get_string(account, info->account_uri_key);
-	char *current = NULL, *tmp;
+	const char *tmp;
+	char *current = NULL;
 	CamelURL *url;
 
 	dropdown = service->providers;
@@ -1480,7 +1481,7 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
 		return;
 	}
 	
-	tmp = (char *)camel_url_get_param(url, "use_ssl");
+	tmp = camel_url_get_param(url, "use_ssl");
 	if (tmp == NULL)
 		tmp = "never";	
 	for (i=0;i<num_ssl_options;i++) {
@@ -1756,8 +1757,8 @@ emae_setup_service(EMAccountEditor *emae, EMAccountEditorService *service, Glade
 
 /* do not re-order these, the order is used by various code to look up emae->priv->identity_entries[] */
 static struct {
-	char *name;
-	int item;
+	const gchar *name;
+	gint item;
 } emae_identity_entries[] = {
 	{ "management_name", E_ACCOUNT_NAME },
 	{ "identity_full_name", E_ACCOUNT_ID_NAME },
@@ -2520,34 +2521,34 @@ emae_widget_glade(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str
 
 /* plugin meta-data for "org.gnome.evolution.mail.config.accountEditor" */
 static EMConfigItem emae_editor_items[] = {
-	{ E_CONFIG_BOOK, "", },
-	{ E_CONFIG_PAGE, "00.identity", "vboxIdentityBorder", emae_identity_page },
-	{ E_CONFIG_SECTION, "00.identity/00.name", "account_vbox", emae_widget_glade },
-	{ E_CONFIG_SECTION_TABLE, "00.identity/10.required", "identity_required_table", emae_widget_glade },
-	{ E_CONFIG_SECTION_TABLE, "00.identity/20.info", "identity_optional_table", emae_widget_glade },
-
-	{ E_CONFIG_PAGE, "10.receive", "vboxSourceBorder", emae_receive_page },
-	{ E_CONFIG_SECTION_TABLE, "10.receive/00.type", "source_type_table", emae_widget_glade },
-	{ E_CONFIG_SECTION_TABLE, "10.receive/10.config", "table4", emae_widget_glade },
-	{ E_CONFIG_SECTION, "10.receive/20.security", "vbox181", emae_widget_glade },
-	{ E_CONFIG_SECTION, "10.receive/30.auth", "vbox179", emae_widget_glade },
-
-	/* Most sections for this is auto-generated fromt the camel config */
-	{ E_CONFIG_PAGE, "20.receive_options", N_("Receiving Options"), },
-	{ E_CONFIG_SECTION_TABLE, "20.receive_options/10.mailcheck", N_("Checking for New Messages"), },
-	{ E_CONFIG_ITEM_TABLE, "20.receive_options/10.mailcheck/00.autocheck", NULL, emae_receive_options_item, },
-
-	{ E_CONFIG_PAGE, "30.send", "vboxTransportBorder", emae_send_page },
-	{ E_CONFIG_SECTION_TABLE, "30.send/00.type", "transport_type_table", emae_widget_glade },
-	{ E_CONFIG_SECTION, "30.send/10.config", "vbox12", emae_widget_glade },
-	{ E_CONFIG_SECTION, "30.send/20.security", "vbox183", emae_widget_glade },
-	{ E_CONFIG_SECTION, "30.send/30.auth", "vbox61", emae_widget_glade },
-
-	{ E_CONFIG_PAGE, "40.defaults", "vboxFoldersBorder", emae_defaults_page },
-	{ E_CONFIG_SECTION, "40.defaults/00.folders", "vbox184", emae_widget_glade },
-	{ E_CONFIG_SECTION_TABLE, "40.defaults/10.composing", "table8", emae_widget_glade },
-
-	{ E_CONFIG_PAGE, "50.security", "vboxSecurityBorder", emae_security_page },
+	{ E_CONFIG_BOOK, (gchar *) "" },
+	{ E_CONFIG_PAGE, (gchar *) "00.identity", (gchar *) "vboxIdentityBorder", emae_identity_page },
+	{ E_CONFIG_SECTION, (gchar *) "00.identity/00.name", (gchar *) "account_vbox", emae_widget_glade },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "00.identity/10.required", (gchar *) "identity_required_table", emae_widget_glade },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "00.identity/20.info", (gchar *) "identity_optional_table", emae_widget_glade },
+
+	{ E_CONFIG_PAGE, (gchar *) "10.receive", (gchar *) "vboxSourceBorder", emae_receive_page },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "10.receive/00.type", (gchar *) "source_type_table", emae_widget_glade },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "10.receive/10.config", (gchar *) "table4", emae_widget_glade },
+	{ E_CONFIG_SECTION, (gchar *) "10.receive/20.security", (gchar *) "vbox181", emae_widget_glade },
+	{ E_CONFIG_SECTION, (gchar *) "10.receive/30.auth", (gchar *) "vbox179", emae_widget_glade },
+
+	/* Most sections for this is auto-generated from the camel config */
+	{ E_CONFIG_PAGE, (gchar *) "20.receive_options", (gchar *) N_("Receiving Options"), },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "20.receive_options/10.mailcheck", (gchar *) N_("Checking for New Messages"), },
+	{ E_CONFIG_ITEM_TABLE, (gchar *) "20.receive_options/10.mailcheck/00.autocheck", NULL, emae_receive_options_item, },
+
+	{ E_CONFIG_PAGE, (gchar *) "30.send", (gchar *) "vboxTransportBorder", emae_send_page },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "30.send/00.type", (gchar *) "transport_type_table", emae_widget_glade },
+	{ E_CONFIG_SECTION, (gchar *) "30.send/10.config", (gchar *) "vbox12", emae_widget_glade },
+	{ E_CONFIG_SECTION, (gchar *) "30.send/20.security", (gchar *) "vbox183", emae_widget_glade },
+	{ E_CONFIG_SECTION, (gchar *) "30.send/30.auth", (gchar *) "vbox61", emae_widget_glade },
+
+	{ E_CONFIG_PAGE, (gchar *) "40.defaults", (gchar *) "vboxFoldersBorder", emae_defaults_page },
+	{ E_CONFIG_SECTION, (gchar *) "40.defaults/00.folders", (gchar *) "vbox184", emae_widget_glade },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "40.defaults/10.composing", (gchar *) "table8", emae_widget_glade },
+
+	{ E_CONFIG_PAGE, (gchar *) "50.security", (gchar *) "vboxSecurityBorder", emae_security_page },
 	/* 1x1 table(!) not vbox: { E_CONFIG_SECTION, "50.security/00.gpg", "table19", emae_widget_glade }, */
 	/* table not vbox: { E_CONFIG_SECTION, "50.security/10.smime", "smime_table", emae_widget_glade }, */
 	{ 0 },
@@ -2613,34 +2614,34 @@ emae_widget_druid_glade(EConfig *ec, EConfigItem *item, struct _GtkWidget *paren
 
 /* plugin meta-data for "org.gnome.evolution.mail.config.accountDruid" */
 static EMConfigItem emae_druid_items[] = {
-	{ E_CONFIG_DRUID, "", },
-	{ E_CONFIG_PAGE_START, "0.start", "start_page", emae_widget_druid_glade },
+	{ E_CONFIG_DRUID, (gchar *) "" },
+	{ E_CONFIG_PAGE_START, (gchar *) "0.start", (gchar *) "start_page", emae_widget_druid_glade },
 
-	{ E_CONFIG_PAGE, "00.identity", "vboxIdentityBorder", emae_identity_page },
-	{ E_CONFIG_SECTION, "00.identity/00.name", "account_vbox", emae_widget_glade },
-	{ E_CONFIG_SECTION_TABLE, "00.identity/10.required", "identity_required_table", emae_widget_glade },
-	{ E_CONFIG_SECTION_TABLE, "00.identity/20.info", "identity_optional_table", emae_widget_glade },
+	{ E_CONFIG_PAGE, (gchar *) "00.identity", (gchar *) "vboxIdentityBorder", emae_identity_page },
+	{ E_CONFIG_SECTION, (gchar *) "00.identity/00.name", (gchar *) "account_vbox", emae_widget_glade },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "00.identity/10.required", (gchar *) "identity_required_table", emae_widget_glade },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "00.identity/20.info", (gchar *) "identity_optional_table", emae_widget_glade },
 
-	{ E_CONFIG_PAGE, "10.receive", "vboxSourceBorder", emae_receive_page },
-	{ E_CONFIG_SECTION_TABLE, "10.receive/00.type", "source_type_table", emae_widget_glade },
-	{ E_CONFIG_SECTION_TABLE, "10.receive/10.config", "table4", emae_widget_glade },
-	{ E_CONFIG_SECTION, "10.receive/20.security", "vbox181", emae_widget_glade },
-	{ E_CONFIG_SECTION, "10.receive/30.auth", "vbox179", emae_widget_glade },
+	{ E_CONFIG_PAGE, (gchar *) "10.receive", (gchar *) "vboxSourceBorder", emae_receive_page },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "10.receive/00.type", (gchar *) "source_type_table", emae_widget_glade },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "10.receive/10.config", (gchar *) "table4", emae_widget_glade },
+	{ E_CONFIG_SECTION, (gchar *) "10.receive/20.security", (gchar *) "vbox181", emae_widget_glade },
+	{ E_CONFIG_SECTION, (gchar *) "10.receive/30.auth", (gchar *) "vbox179", emae_widget_glade },
 
 	/* Most sections for this is auto-generated fromt the camel config */
-	{ E_CONFIG_PAGE, "20.receive_options", N_("Receiving Options"), },
-	{ E_CONFIG_SECTION_TABLE, "20.receive_options/10.mailcheck", N_("Checking for New Messages"), },
-	{ E_CONFIG_ITEM_TABLE, "20.receive_options/10.mailcheck/00.autocheck", NULL, emae_receive_options_item, },
+	{ E_CONFIG_PAGE, (gchar *) "20.receive_options", (gchar *) N_("Receiving Options"), },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "20.receive_options/10.mailcheck", (gchar *) N_("Checking for New Messages"), },
+	{ E_CONFIG_ITEM_TABLE, (gchar *) "20.receive_options/10.mailcheck/00.autocheck", NULL, emae_receive_options_item, },
 
-	{ E_CONFIG_PAGE, "30.send", "vboxTransportBorder", emae_send_page },
-	{ E_CONFIG_SECTION_TABLE, "30.send/00.type", "transport_type_table", emae_widget_glade },
-	{ E_CONFIG_SECTION, "30.send/10.config", "vbox12", emae_widget_glade },
-	{ E_CONFIG_SECTION, "30.send/20.security", "vbox183", emae_widget_glade },
-	{ E_CONFIG_SECTION, "30.send/30.auth", "vbox61", emae_widget_glade },
+	{ E_CONFIG_PAGE, (gchar *) "30.send", (gchar *) "vboxTransportBorder", emae_send_page },
+	{ E_CONFIG_SECTION_TABLE, (gchar *) "30.send/00.type", (gchar *) "transport_type_table", emae_widget_glade },
+	{ E_CONFIG_SECTION, (gchar *) "30.send/10.config", (gchar *) "vbox12", emae_widget_glade },
+	{ E_CONFIG_SECTION, (gchar *) "30.send/20.security", (gchar *) "vbox183", emae_widget_glade },
+	{ E_CONFIG_SECTION, (gchar *) "30.send/30.auth", (gchar *) "vbox61", emae_widget_glade },
 
-	{ E_CONFIG_PAGE, "40.management", "management_frame", emae_management_page },
+	{ E_CONFIG_PAGE, (gchar *) "40.management", (gchar *) "management_frame", emae_management_page },
 
-	{ E_CONFIG_PAGE_FINISH, "999.end", "finish_page", emae_widget_druid_glade },
+	{ E_CONFIG_PAGE_FINISH, (gchar *) "999.end", (gchar *) "finish_page", emae_widget_druid_glade },
 	{ 0 },
 };
 static gboolean emae_druid_items_translated = FALSE;
@@ -2714,11 +2715,11 @@ enum {
 	AOL
 };
 struct _server_prefill {
-	char *key;
-	char *recv;
-	char *send;
-	char *proto;
-	char *ssl;
+	const gchar *key;
+	const gchar *recv;
+	const gchar *send;
+	const gchar *proto;
+	const gchar *ssl;
 } mail_servers [] = {
 	{"gmail", "imap.gmail.com", "smtp.gmail.com", "imap", "always"},
 	{"yahoo", "pop3.yahoo.com", "smtp.yahoo.com", "pop", "never"},
@@ -2873,8 +2874,9 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
 			&& ((tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_REPLY_TO)) == NULL
 			    || tmp[0] == 0
 			    || is_email(tmp));
-		if (!ok)
+		if (!ok) {
 			d(printf("identity incomplete\n"));
+		}
 	}
 
 	if (ok && (pageid == NULL || !strcmp(pageid, "10.receive"))) {
@@ -2882,8 +2884,9 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
 			emae_refresh_providers(emae, &emae->priv->source);
 		}
 		ok = emae_service_complete(emae, &emae->priv->source);
-		if (!ok)
+		if (!ok) {
 			d(printf("receive page incomplete\n"));
+		}
 	}
 
 	if (ok && (pageid == NULL || !strcmp(pageid, "30.send"))) {
@@ -2891,8 +2894,9 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
 			emae_refresh_providers(emae, &emae->priv->transport);
 		}
 		ok = emae_service_complete(emae, &emae->priv->transport);
-		if (!ok)
+		if (!ok) {
 			d(printf("send page incomplete\n"));
+		}
 	}
 
 	if (ok && (pageid == NULL || !strcmp(pageid, "40.management"))) {
@@ -2900,8 +2904,9 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
 			&& tmp[0]
 			&& ((ea = mail_config_get_account_by_name(tmp)) == NULL
 			    || ea == emae->original);
-		if (!ok)
+		if (!ok) {
 			d(printf("management page incomplete\n"));
+		}
 	}
 
 	return ok;
@@ -2973,7 +2978,7 @@ emae_editor_destroyed(GtkWidget *dialog, EMAccountEditor *emae)
 }
 
 static void
-em_account_editor_construct(EMAccountEditor *emae, EAccount *account, em_account_editor_t type, char *id)
+em_account_editor_construct(EMAccountEditor *emae, EAccount *account, em_account_editor_t type, const gchar *id)
 {
 	EMAccountEditorPrivate *gui = emae->priv;
 	int i, index;
-- 
cgit 


From e4afd3f9fb962ea1295a0657ec9f83a427829171 Mon Sep 17 00:00:00 2001
From: Matthew Barnes <mbarnes@redhat.com>
Date: Tue, 26 May 2009 23:21:02 -0400
Subject: Remove trailing whitespace, again.

---
 mail/em-account-editor.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

(limited to 'mail/em-account-editor.c')

diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index fc61cdc84b..2b13e7e015 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -10,7 +10,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
  *
  *
  * Authors:
@@ -1422,7 +1422,7 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
 	} else {
 		current = g_strdup("imap");
 	}
-	
+
 	store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
 
 	i = 0;
@@ -1448,7 +1448,7 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
 
 		gtk_list_store_append(store, &iter);
 		gtk_list_store_set(store, &iter, 0, provider->name, 1, provider, -1);
-		
+
 		/* find the displayed and set default */
 		if (i == 0 || (current && strcmp(provider->protocol, current) == 0)) {
 			service->provider = provider;
@@ -1480,10 +1480,10 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
 	if (!uri  || (url = camel_url_new(uri, NULL)) == NULL) {
 		return;
 	}
-	
+
 	tmp = camel_url_get_param(url, "use_ssl");
 	if (tmp == NULL)
-		tmp = "never";	
+		tmp = "never";
 	for (i=0;i<num_ssl_options;i++) {
 		if (!strcmp(ssl_options[i].value, tmp)) {
 			gtk_combo_box_set_active(service->use_ssl, i);
@@ -2370,7 +2370,7 @@ emae_send_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct
 		gtk_box_pack_start((GtkBox*)((GnomeDruidPageStandard *)page)->vbox, w, TRUE, TRUE, 0);
 		w = page;
 		g_object_unref(druidxml);
-		gnome_druid_append_page((GnomeDruid *)parent, (GnomeDruidPage *)page);	
+		gnome_druid_append_page((GnomeDruid *)parent, (GnomeDruidPage *)page);
 	} else {
 		gtk_notebook_append_page((GtkNotebook *)parent, w, gtk_label_new(_("Sending Email")));
 	}
@@ -2687,7 +2687,7 @@ emae_service_complete(EMAccountEditor *emae, EMAccountEditorService *service)
 	if (CAMEL_PROVIDER_NEEDS(service->provider, CAMEL_URL_PART_HOST)) {
 		if (url->host == NULL || url->host[0] == 0)
 			ok = FALSE;
-		else 
+		else
 			gtk_entry_set_text(service->hostname, url->host);
 	}
 	/* We only need the user if the service needs auth as well, i think */
@@ -2802,14 +2802,14 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
 				} else {
 					g_warning("buz1\n");
 				}
-				
+
 			}
 		} else if (!strcmp(pageid, "30.send")) {
 				CamelURL *url;
 				char *at, *user;
 				int index;
 				char *uri = (char *)e_account_get_string(emae->account, E_ACCOUNT_TRANSPORT_URL);
-				
+
 				tmp = e_account_get_string(emae->account, E_ACCOUNT_ID_ADDRESS);
 				at = strchr(tmp, '@');
 				user = g_alloca(at-tmp+1);
@@ -2831,8 +2831,8 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
 				} 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) {
@@ -3095,5 +3095,5 @@ em_account_editor_construct(EMAccountEditor *emae, EAccount *account, em_account
 		g_signal_connect(emae->editor, "destroy", G_CALLBACK(emae_editor_destroyed), emae);
 	} else {
 		e_config_create_widget((EConfig *)ec);
-	} 
+	}
 }
-- 
cgit