aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-16 21:11:05 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-16 21:11:05 +0800
commitd041967019edda596ad98bd6d27e928dc2b7fd53 (patch)
tree8155d07342114d85f46717fdcad5f24515d00645
parent7e37089963000a4dcce907f2e4e8849bd0c97a06 (diff)
parent700d6bc82ed3e3a83788c6ae27df0124157e847e (diff)
downloadgsoc2013-empathy-d041967019edda596ad98bd6d27e928dc2b7fd53.tar
gsoc2013-empathy-d041967019edda596ad98bd6d27e928dc2b7fd53.tar.gz
gsoc2013-empathy-d041967019edda596ad98bd6d27e928dc2b7fd53.tar.bz2
gsoc2013-empathy-d041967019edda596ad98bd6d27e928dc2b7fd53.tar.lz
gsoc2013-empathy-d041967019edda596ad98bd6d27e928dc2b7fd53.tar.xz
gsoc2013-empathy-d041967019edda596ad98bd6d27e928dc2b7fd53.tar.zst
gsoc2013-empathy-d041967019edda596ad98bd6d27e928dc2b7fd53.zip
Merge branch 'desktop-schema-626810'
-rw-r--r--configure.ac3
-rw-r--r--libempathy-gtk/empathy-chat-text-view.c38
-rw-r--r--libempathy-gtk/empathy-theme-adium.c30
-rw-r--r--libempathy/empathy-gsettings.h3
-rw-r--r--src/cc-empathy-accounts-panel.c9
5 files changed, 29 insertions, 54 deletions
diff --git a/configure.ac b/configure.ac
index d2f09df1b..0ae7f47db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,6 @@ AC_COPYRIGHT([
# Hardp deps
FOLKS_REQUIRED=0.3.2
-GCONF_REQUIRED=1.2.0
GLIB_REQUIRED=2.27.2
GNUTLS_REQUIRED=2.8.5
GTK_REQUIRED=2.91.3
@@ -147,13 +146,13 @@ PKG_CHECK_MODULES(EMPATHY,
farsight2-0.10
folks >= $FOLKS_REQUIRED
folks-telepathy >= $FOLKS_REQUIRED
- gconf-2.0 >= $GCONF_REQUIRED
gio-2.0 >= $GLIB_REQUIRED
gio-unix-2.0 >= $GLIB_REQUIRED
gnome-keyring-1 >= $KEYRING_REQUIRED
gnutls >= $GNUTLS_REQUIRED
gmodule-export-2.0
gobject-2.0
+ gsettings-desktop-schemas
gstreamer-0.10
gstreamer-interfaces-0.10
libxml-2.0
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);
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index b9b6169ef..921956e74 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -28,7 +28,6 @@
#include <telepathy-glib/dbus.h>
#include <telepathy-glib/util.h>
-#include <gconf/gconf-client.h>
#include <pango/pango.h>
#include <gdk/gdk.h>
@@ -48,8 +47,6 @@
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyThemeAdium)
-/* GConf key containing current value of font */
-#define EMPATHY_GCONF_FONT_KEY_NAME "/desktop/gnome/interface/document_font_name"
#define BORING_DPI_DEFAULT 96
/* "Join" consecutive messages with timestamps within five minutes */
@@ -981,24 +978,21 @@ theme_adium_inspect_web_view_cb (WebKitWebInspector *inspector,
static PangoFontDescription *
theme_adium_get_default_font (void)
{
- GConfClient *gconf_client;
+ GSettings *gsettings;
PangoFontDescription *pango_fd;
- gchar *gconf_font_family;
+ gchar *font_family;
- gconf_client = gconf_client_get_default ();
- if (gconf_client == NULL) {
- return NULL;
- }
- gconf_font_family = gconf_client_get_string (gconf_client,
- EMPATHY_GCONF_FONT_KEY_NAME,
- NULL);
- if (gconf_font_family == NULL) {
- g_object_unref (gconf_client);
+ gsettings = g_settings_new (EMPATHY_PREFS_DESKTOP_INTERFACE_SCHEMA);
+
+ font_family = g_settings_get_string (gsettings,
+ EMPATHY_PREFS_DESKTOP_INTERFACE_DOCUMENT_FONT_NAME);
+
+ if (font_family == NULL)
return NULL;
- }
- pango_fd = pango_font_description_from_string (gconf_font_family);
- g_free (gconf_font_family);
- g_object_unref (gconf_client);
+
+ pango_fd = pango_font_description_from_string (font_family);
+ g_free (font_family);
+ g_object_unref (gsettings);
return pango_fd;
}
diff --git a/libempathy/empathy-gsettings.h b/libempathy/empathy-gsettings.h
index aba78c880..6c4f73a55 100644
--- a/libempathy/empathy-gsettings.h
+++ b/libempathy/empathy-gsettings.h
@@ -91,6 +91,9 @@ G_BEGIN_DECLS
#define EMPATHY_PREFS_LOGGER_SCHEMA "org.freedesktop.Telepathy.Logger"
#define EMPATHY_PREFS_LOGGER_ENABLED "enabled"
+#define EMPATHY_PREFS_DESKTOP_INTERFACE_SCHEMA "org.gnome.desktop.interface"
+#define EMPATHY_PREFS_DESKTOP_INTERFACE_DOCUMENT_FONT_NAME "document-font-name"
+
G_END_DECLS
#endif /* __EMPATHY_GSETTINGS_H__ */
diff --git a/src/cc-empathy-accounts-panel.c b/src/cc-empathy-accounts-panel.c
index d4dbf1e97..24be69121 100644
--- a/src/cc-empathy-accounts-panel.c
+++ b/src/cc-empathy-accounts-panel.c
@@ -29,7 +29,6 @@
#include <glib/gi18n-lib.h>
#include <telepathy-glib/telepathy-glib.h>
-#include <gconf/gconf-client.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-connection-managers.h>
@@ -214,20 +213,12 @@ cc_empathy_accounts_panel_class_finalize (CcEmpathyAccountsPanelClass *klass)
static void
cc_empathy_accounts_panel_init (CcEmpathyAccountsPanel *panel)
{
- GConfClient *client;
TpAccountManager *account_manager;
panel->priv = CC_EMPATHY_ACCOUNTS_PANEL_GET_PRIVATE (panel);
empathy_gtk_init ();
- client = gconf_client_get_default ();
- gconf_client_add_dir (client, "/desktop/gnome/peripherals/empathy_accounts",
- GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
- gconf_client_add_dir (client, "/desktop/gnome/interface",
- GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
- g_object_unref (client);
-
/* unref'd in final endpoint callbacks */
account_manager = tp_account_manager_dup ();