aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-12-22 18:52:11 +0800
committerMilan Crha <mcrha@redhat.com>2009-12-22 18:52:11 +0800
commit9112fc1490a9befad31dd3ec5ae3f919d8738f5b (patch)
tree3e1845c96188f867e3f9e3a0ec7df2739daaca99
parentd54c50216601ee122fd76a01e6c0dd26b5c25f21 (diff)
downloadgsoc2013-evolution-9112fc1490a9befad31dd3ec5ae3f919d8738f5b.tar.gz
gsoc2013-evolution-9112fc1490a9befad31dd3ec5ae3f919d8738f5b.tar.zst
gsoc2013-evolution-9112fc1490a9befad31dd3ec5ae3f919d8738f5b.zip
Bug #600521 - Remove trailing spaces from particular account fields
-rw-r--r--mail/em-account-editor.c13
1 files changed, 10 insertions, 3 deletions
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