[empathy] strip the new group name



commit 4551d97be43ff1bee62c4a8ff68887ce8c083e26
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri Apr 20 11:39:24 2012 +0200

    strip the new group name
    
    https://bugzilla.gnome.org/show_bug.cgi?id=501065

 libempathy-gtk/empathy-individual-view.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index 6ca8d5c..c048124 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]