[empathy] factor out empathy_chat_get_name



commit c09471eb2c996367eb023f430b4fa3e599c9df09
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Nov 25 16:12:02 2009 +0000

    factor out empathy_chat_get_name
    
    Dup the string as we are going to use g_strdup_printf

 src/empathy-chat-window.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 278c8f0..ca509a8 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -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



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