aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat-text-view.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-11 22:42:14 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-16 16:00:55 +0800
commit87f228d727344e28bb9d87f6a86845f6473a38b0 (patch)
treef8369d42520db046adabbf4bf48ba333e1915d01 /libempathy-gtk/empathy-chat-text-view.c
parenta908b286fe5cc825f61cee64298395685b81b09d (diff)
downloadgsoc2013-empathy-87f228d727344e28bb9d87f6a86845f6473a38b0.tar
gsoc2013-empathy-87f228d727344e28bb9d87f6a86845f6473a38b0.tar.gz
gsoc2013-empathy-87f228d727344e28bb9d87f6a86845f6473a38b0.tar.bz2
gsoc2013-empathy-87f228d727344e28bb9d87f6a86845f6473a38b0.tar.lz
gsoc2013-empathy-87f228d727344e28bb9d87f6a86845f6473a38b0.tar.xz
gsoc2013-empathy-87f228d727344e28bb9d87f6a86845f6473a38b0.tar.zst
gsoc2013-empathy-87f228d727344e28bb9d87f6a86845f6473a38b0.zip
use gsettings version of the document-font-name key (#626810)
Diffstat (limited to 'libempathy-gtk/empathy-chat-text-view.c')
-rw-r--r--libempathy-gtk/empathy-chat-text-view.c38
1 files changed, 13 insertions, 25 deletions
diff --git a/libempathy-gtk/empathy-chat-text-view.c b/libempathy-gtk/empathy-chat-text-view.c
index 07ad45dbd..644bd0077 100644
--- a/libempathy-gtk/empathy-chat-text-view.c
+++ b/libempathy-gtk/empathy-chat-text-view.c
@@ -32,7 +32,6 @@
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
-#include <gconf/gconf-client.h>
#include <telepathy-glib/util.h>
@@ -69,7 +68,7 @@ typedef struct {
time_t last_timestamp;
gboolean allow_scrolling;
guint notify_system_fonts_id;
- GConfClient *gconf_client;
+ GSettings *gsettings;
EmpathySmileyManager *smiley_manager;
gboolean only_if_date;
} EmpathyChatTextViewPriv;
@@ -209,9 +208,8 @@ chat_text_view_system_font_update (EmpathyChatTextView *view)
PangoFontDescription *font_description = NULL;
gchar *font_name;
- font_name = gconf_client_get_string (priv->gconf_client,
- "/desktop/gnome/interface/document_font_name",
- NULL);
+ font_name = g_settings_get_string (priv->gsettings,
+ EMPATHY_PREFS_DESKTOP_INTERFACE_DOCUMENT_FONT_NAME);
if (font_name != NULL) {
font_description = pango_font_description_from_string (font_name);
@@ -228,14 +226,11 @@ chat_text_view_system_font_update (EmpathyChatTextView *view)
}
static void
-chat_text_view_notify_system_font_cb (GConfClient *conf,
- guint id,
- GConfEntry *entry,
- gpointer user_data)
+chat_text_view_notify_system_font_cb (GSettings *gsettings,
+ const gchar *key,
+ EmpathyChatTextView *self)
{
- EmpathyChatTextView *view = user_data;
-
- chat_text_view_system_font_update (view);
+ chat_text_view_system_font_update (self);
}
static void
@@ -565,9 +560,7 @@ chat_text_view_finalize (GObject *object)
DEBUG ("%p", object);
- gconf_client_notify_remove (priv->gconf_client,
- priv->notify_system_fonts_id);
- g_object_unref (priv->gconf_client);
+ g_object_unref (priv->gsettings);
if (priv->last_contact) {
g_object_unref (priv->last_contact);
@@ -642,16 +635,11 @@ empathy_chat_text_view_init (EmpathyChatTextView *view)
"cursor-visible", FALSE,
NULL);
- priv->gconf_client = gconf_client_get_default ();
- gconf_client_add_dir (priv->gconf_client,
- "/desktop/gnome/interface",
- GCONF_CLIENT_PRELOAD_ONELEVEL,
- NULL);
- priv->notify_system_fonts_id =
- gconf_client_notify_add (priv->gconf_client,
- "/desktop/gnome/interface/document_font_name",
- chat_text_view_notify_system_font_cb,
- view, NULL, NULL);
+ priv->gsettings = g_settings_new (EMPATHY_PREFS_DESKTOP_INTERFACE_SCHEMA);
+ g_signal_connect (priv->gsettings,
+ "changed::" EMPATHY_PREFS_DESKTOP_INTERFACE_DOCUMENT_FONT_NAME,
+ G_CALLBACK (chat_text_view_notify_system_font_cb),
+ view);
chat_text_view_system_font_update (view);
chat_text_view_create_tags (view);