From c09471eb2c996367eb023f430b4fa3e599c9df09 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 25 Nov 2009 16:12:02 +0000 Subject: [PATCH] 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 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 278c8f04..ca509a8d 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 -- 2.39.2