From 4551d97be43ff1bee62c4a8ff68887ce8c083e26 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 20 Apr 2012 11:39:24 +0200 Subject: strip the new group name https://bugzilla.gnome.org/show_bug.cgi?id=501065 --- libempathy-gtk/empathy-individual-view.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index 6ca8d5c00..c04812415 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -1821,16 +1821,19 @@ static gchar * empathy_individual_view_dup_selected_group ( static void text_edited_cb (GtkCellRendererText *cellrenderertext, gchar *path, - gchar *new_name, + gchar *name, EmpathyIndividualView *self) { EmpathyIndividualViewPriv *priv = GET_PRIV (self); - gchar *old_name; + gchar *old_name, *new_name; g_object_set (priv->text_renderer, "editable", FALSE, NULL); + new_name = g_strdup (name); + g_strstrip (new_name); + if (tp_str_empty (new_name)) - return; + goto out; old_name = empathy_individual_view_dup_selected_group (self, NULL); g_return_if_fail (old_name != NULL); @@ -1849,6 +1852,8 @@ text_edited_cb (GtkCellRendererText *cellrenderertext, } g_free (old_name); +out: + g_free (new_name); } static void -- cgit v1.2.3