aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-chat-window.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-17 16:39:43 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-17 16:39:43 +0800
commita631e25e2ec0d4fdf0f526a38df6171a6a6b26bd (patch)
tree44eaef8823e456d8d799e20b1d85f3649199ac2b /src/empathy-chat-window.c
parent92be64204fc424a3b2756be253b985112dcedcf2 (diff)
downloadgsoc2013-empathy-a631e25e2ec0d4fdf0f526a38df6171a6a6b26bd.tar
gsoc2013-empathy-a631e25e2ec0d4fdf0f526a38df6171a6a6b26bd.tar.gz
gsoc2013-empathy-a631e25e2ec0d4fdf0f526a38df6171a6a6b26bd.tar.bz2
gsoc2013-empathy-a631e25e2ec0d4fdf0f526a38df6171a6a6b26bd.tar.lz
gsoc2013-empathy-a631e25e2ec0d4fdf0f526a38df6171a6a6b26bd.tar.xz
gsoc2013-empathy-a631e25e2ec0d4fdf0f526a38df6171a6a6b26bd.tar.zst
gsoc2013-empathy-a631e25e2ec0d4fdf0f526a38df6171a6a6b26bd.zip
chat-window: cache the 'chat' gsettings
We use it each time the window is focused so best to reduce the D-Bus traffic (#635022).
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r--src/empathy-chat-window.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 43c4fabf6..4aba2af2d 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -111,6 +111,8 @@ typedef struct {
/* Last user action time we acted upon to show a tab */
guint32 x_user_action_time;
+
+ GSettings *gsettings_chat;
} EmpathyChatWindowPriv;
static GList *chat_windows = NULL;
@@ -533,9 +535,7 @@ chat_window_icon_update (EmpathyChatWindowPriv *priv)
gtk_window_set_icon_name (GTK_WINDOW (priv->dialog),
EMPATHY_IMAGE_MESSAGE);
} else {
- GSettings *gsettings = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
-
- avatar_in_icon = g_settings_get_boolean (gsettings,
+ avatar_in_icon = g_settings_get_boolean (priv->gsettings_chat,
EMPATHY_PREFS_CHAT_AVATAR_IN_ICON);
if (n_chats == 1 && avatar_in_icon) {
@@ -549,8 +549,6 @@ chat_window_icon_update (EmpathyChatWindowPriv *priv)
} else {
gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), NULL);
}
-
- g_object_unref (gsettings);
}
}
@@ -1875,6 +1873,7 @@ chat_window_finalize (GObject *object)
g_object_unref (priv->ui_manager);
g_object_unref (priv->chatroom_manager);
g_object_unref (priv->notify_mgr);
+ g_object_unref (priv->gsettings_chat);
if (priv->notification != NULL) {
notify_notification_close (priv->notification, NULL);
@@ -1985,6 +1984,7 @@ empathy_chat_window_init (EmpathyChatWindow *window)
g_object_ref (priv->ui_manager);
g_object_unref (gui);
+ priv->gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
priv->chatroom_manager = empathy_chatroom_manager_dup_singleton (NULL);
priv->notebook = gtk_notebook_new ();