]> git.0d.be Git - empathy.git/commitdiff
factor out empathy_chat_get_name
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 25 Nov 2009 16:12:02 +0000 (16:12 +0000)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 27 Nov 2009 15:24:59 +0000 (15:24 +0000)
Dup the string as we are going to use g_strdup_printf

src/empathy-chat-window.c

index 278c8f044e3ceca946dc9835b91060ec80fd7b0f..ca509a8d68507a26494af250eecf7544ee4da79c 100644 (file)
@@ -356,16 +356,22 @@ chat_window_contact_menu_update (EmpathyChatWindowPriv *priv,
        }
 }
 
+static gchar *
+get_window_title_name (EmpathyChatWindowPriv *priv)
+{
+       return g_strdup (empathy_chat_get_name (priv->current_chat));
+}
+
 static void
 chat_window_title_update (EmpathyChatWindowPriv *priv)
 {
-       const gchar *name;
-
-       name = empathy_chat_get_name (priv->current_chat);
+       gchar *name;
 
        DEBUG ("Update window : Title");
 
+       name = get_window_title_name (priv);
        gtk_window_set_title (GTK_WINDOW (priv->dialog), name);
+       g_free (name);
 }
 
 static void