aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-chat-window.c
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2010-06-10 12:16:00 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2010-06-18 09:34:19 +0800
commit96569c764125b9c80909c7cece9e37b65eb632ca (patch)
tree27afa60ac7dc1c6bce5195b8b9bcf645b6fe97a6 /src/empathy-chat-window.c
parentf748067f6fa10635261313a28e0a0102168de91e (diff)
downloadgsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.tar
gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.tar.gz
gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.tar.bz2
gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.tar.lz
gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.tar.xz
gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.tar.zst
gsoc2013-empathy-96569c764125b9c80909c7cece9e37b65eb632ca.zip
Port Empathy code to GSettings, remove EmpathyConf
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r--src/empathy-chat-window.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 8a0502b26..a80d3fee5 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -41,12 +41,12 @@
#include <libempathy/empathy-contact.h>
#include <libempathy/empathy-message.h>
#include <libempathy/empathy-chatroom-manager.h>
+#include <libempathy/empathy-gsettings.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-tp-contact-factory.h>
#include <libempathy/empathy-contact-list.h>
#include <libempathy-gtk/empathy-images.h>
-#include <libempathy-gtk/empathy-conf.h>
#include <libempathy-gtk/empathy-contact-dialogs.h>
#include <libempathy-gtk/empathy-log-window.h>
#include <libempathy-gtk/empathy-geometry.h>
@@ -519,9 +519,10 @@ chat_window_icon_update (EmpathyChatWindowPriv *priv)
gtk_window_set_icon_name (GTK_WINDOW (priv->dialog),
EMPATHY_IMAGE_MESSAGE);
} else {
- empathy_conf_get_bool (empathy_conf_get (),
- EMPATHY_PREFS_CHAT_AVATAR_IN_ICON,
- &avatar_in_icon);
+ GSettings *gsettings = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
+
+ avatar_in_icon = g_settings_get_boolean (gsettings,
+ EMPATHY_PREFS_CHAT_AVATAR_IN_ICON);
if (n_chats == 1 && avatar_in_icon) {
remote_contact = empathy_chat_get_remote_contact (priv->current_chat);
@@ -534,6 +535,8 @@ chat_window_icon_update (EmpathyChatWindowPriv *priv)
} else {
gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), NULL);
}
+
+ g_object_unref (gsettings);
}
}
@@ -1264,8 +1267,14 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window,
if (!empathy_notify_manager_notification_is_enabled (priv->notify_mgr)) {
return;
} else {
- empathy_conf_get_bool (empathy_conf_get (),
- EMPATHY_PREFS_NOTIFICATIONS_FOCUS, &res);
+ GSettings *gsettings = g_settings_new (
+ EMPATHY_PREFS_NOTIFICATIONS_SCHEMA);
+
+ res = g_settings_get_boolean (gsettings,
+ EMPATHY_PREFS_NOTIFICATIONS_FOCUS);
+
+ g_object_unref (gsettings);
+
if (!res) {
return;
}
@@ -2068,12 +2077,14 @@ empathy_chat_window_new (void)
EmpathyChatWindow *
empathy_chat_window_get_default (gboolean room)
{
+ GSettings *gsettings = g_settings_new (EMPATHY_PREFS_UI_SCHEMA);
GList *l;
gboolean separate_windows = TRUE;
- empathy_conf_get_bool (empathy_conf_get (),
- EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS,
- &separate_windows);
+ separate_windows = g_settings_get_boolean (gsettings,
+ EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS);
+
+ g_object_unref (gsettings);
if (separate_windows) {
/* Always create a new window */
@@ -2141,12 +2152,14 @@ empathy_chat_window_add_chat (EmpathyChatWindow *window,
/* If this window has just been created, position it */
if (priv->chats == NULL) {
+ GSettings *gsettings = g_settings_new (EMPATHY_PREFS_UI_SCHEMA);
const gchar *name = "chat-window";
gboolean separate_windows;
- empathy_conf_get_bool (empathy_conf_get (),
- EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS,
- &separate_windows);
+ separate_windows = g_settings_get_boolean (gsettings,
+ EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS);
+
+ g_object_unref (gsettings);
if (separate_windows) {
name = empathy_chat_get_id (chat);