From 9112fc1490a9befad31dd3ec5ae3f919d8738f5b Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 22 Dec 2009 11:52:11 +0100 Subject: Bug #600521 - Remove trailing spaces from particular account fields --- mail/em-account-editor.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'mail') diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 0986424c88..c4a9b3bad3 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -980,14 +980,18 @@ static void emae_account_entry_changed (GtkEntry *entry, EMAccountEditor *emae) { EAccount *account; - const gchar *text; + gchar *text; gpointer data; account = em_account_editor_get_modified_account (emae); data = g_object_get_data (G_OBJECT (entry), "account-item"); - text = gtk_entry_get_text (entry); + text = g_strdup (gtk_entry_get_text (entry)); + + g_strstrip (text); e_account_set_string (account, GPOINTER_TO_INT (data), text); + + g_free (text); } static GtkEntry * @@ -1386,7 +1390,9 @@ emae_service_url_changed (EMAccountEditorService *service, void (*setval)(CamelU CamelServiceAuthType *authtype; CamelURL *url = emae_account_url (service->emae, emae_service_info[service->type].account_uri_key); - const gchar *text = gtk_entry_get_text (entry); + gchar *text = g_strdup (gtk_entry_get_text (entry)); + + g_strstrip (text); setval (url, (text && text[0])?text:NULL); @@ -1407,6 +1413,7 @@ emae_service_url_changed (EMAccountEditorService *service, void (*setval)(CamelU emae_uri_changed (service, url); camel_url_free (url); + g_free (text); } static void -- cgit v1.2.3