aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-sound.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 /libempathy-gtk/empathy-sound.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 'libempathy-gtk/empathy-sound.c')
-rw-r--r--libempathy-gtk/empathy-sound.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/libempathy-gtk/empathy-sound.c b/libempathy-gtk/empathy-sound.c
index 74dcf6a2e..03f041916 100644
--- a/libempathy-gtk/empathy-sound.c
+++ b/libempathy-gtk/empathy-sound.c
@@ -27,15 +27,14 @@
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include <libempathy/empathy-debug.h>
+#include <libempathy/empathy-gsettings.h>
#include <libempathy/empathy-utils.h>
-#include "empathy-conf.h"
-
typedef struct {
EmpathySound sound_id;
const char * event_ca_id;
const char * event_ca_description;
- const char * gconf_key;
+ const char * key;
} EmpathySoundEntry;
typedef struct {
@@ -79,32 +78,37 @@ static gboolean
empathy_sound_pref_is_enabled (EmpathySound sound_id)
{
EmpathySoundEntry *entry;
- EmpathyConf *conf;
+ GSettings *gsettings = g_settings_new (EMPATHY_PREFS_SOUNDS_SCHEMA);
gboolean res;
entry = &(sound_entries[sound_id]);
g_return_val_if_fail (entry->sound_id == sound_id, FALSE);
- if (entry->gconf_key == NULL)
- return TRUE;
-
- conf = empathy_conf_get ();
- res = FALSE;
+ if (entry->key == NULL)
+ {
+ res = TRUE;
+ goto finally;
+ }
- empathy_conf_get_bool (conf, EMPATHY_PREFS_SOUNDS_ENABLED, &res);
+ res = g_settings_get_boolean (gsettings, EMPATHY_PREFS_SOUNDS_ENABLED);
if (!res)
- return FALSE;
+ goto finally;
if (!empathy_check_available_state ())
{
- empathy_conf_get_bool (conf, EMPATHY_PREFS_SOUNDS_DISABLED_AWAY, &res);
-
- if (res)
- return FALSE;
+ if (g_settings_get_boolean (gsettings,
+ EMPATHY_PREFS_SOUNDS_DISABLED_AWAY))
+ {
+ res = FALSE;
+ goto finally;
+ }
}
- empathy_conf_get_bool (conf, entry->gconf_key, &res);
+ res = g_settings_get_boolean (gsettings, entry->key);
+
+finally:
+ g_object_unref (gsettings);
return res;
}