From 8ad18e775be48cb52a6b182b88a831255793f465 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 10 Apr 2008 08:24:31 +0000 Subject: spaces in address and server entries are automatically removed at applying account configuration. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1974 ee746299-78ed-0310-b773-934348b2243d --- src/gtkutils.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/gtkutils.c') diff --git a/src/gtkutils.c b/src/gtkutils.c index 9294587b..367a5919 100644 --- a/src/gtkutils.c +++ b/src/gtkutils.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2007 Hiroyuki Yamamoto + * Copyright (C) 1999-2008 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,6 +40,7 @@ #include #include #include +#include #include #ifdef G_OS_WIN32 @@ -750,6 +751,19 @@ void gtkut_editable_disable_im(GtkEditable *editable) #endif } +void gtkut_entry_strip_text(GtkEntry *entry) +{ + gchar *text; + gint len; + + text = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); + len = strlen(text); + g_strstrip(text); + if (len > strlen(text)) + gtk_entry_set_text(entry, text); + g_free(text); +} + void gtkut_container_remove(GtkContainer *container, GtkWidget *widget) { gtk_container_remove(container, widget); -- cgit v1.2.3