summaryrefslogtreecommitdiff
path: root/plugins/sound/msd-sound-manager.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-10-01 22:58:54 +0200
committerStefano Karapetsas <[email protected]>2012-10-01 22:58:54 +0200
commitd2c7965aa092cecb857bd0301b7c9ff2dc10f9f8 (patch)
tree016ada3eb78c3c6f438abab5635ba17474d47a2b /plugins/sound/msd-sound-manager.c
parent03478b4d1d9fdc5f2f2fdbf9c41d963dabc0d00b (diff)
downloadmate-settings-daemon-d2c7965aa092cecb857bd0301b7c9ff2dc10f9f8.tar.bz2
mate-settings-daemon-d2c7965aa092cecb857bd0301b7c9ff2dc10f9f8.tar.xz
migrate to gsettingsmate-settings-daemon-1.5.0
Diffstat (limited to 'plugins/sound/msd-sound-manager.c')
-rw-r--r--plugins/sound/msd-sound-manager.c50
1 files changed, 12 insertions, 38 deletions
diff --git a/plugins/sound/msd-sound-manager.c b/plugins/sound/msd-sound-manager.c
index 23fb240..c92becd 100644
--- a/plugins/sound/msd-sound-manager.c
+++ b/plugins/sound/msd-sound-manager.c
@@ -33,7 +33,7 @@
#include <glib.h>
#include <glib/gi18n.h>
-#include <mateconf/mateconf-client.h>
+#include <gio/gio.h>
#include <gtk/gtk.h>
#ifdef HAVE_PULSE
@@ -47,12 +47,12 @@
struct MsdSoundManagerPrivate
{
- guint mateconf_notify;
+ GSettings *settings;
GList* monitors;
guint timeout;
};
-#define MATECONF_SOUND_DIR "/desktop/mate/sound"
+#define MATE_SOUND_SCHEMA "org.mate.sound"
static void msd_sound_manager_class_init (MsdSoundManagerClass *klass);
static void msd_sound_manager_init (MsdSoundManager *sound_manager);
@@ -205,35 +205,13 @@ trigger_flush (MsdSoundManager *manager)
}
static void
-mateconf_client_notify_cb (MateConfClient *client,
- guint cnxn_id,
- MateConfEntry *entry,
- MsdSoundManager *manager)
+gsettings_notify_cb (GSettings *client,
+ gchar *key,
+ MsdSoundManager *manager)
{
trigger_flush (manager);
}
-static gboolean
-register_config_callback (MsdSoundManager *manager, GError **error)
-{
- MateConfClient *client;
- gboolean succ;
-
- client = mateconf_client_get_default ();
-
- mateconf_client_add_dir (client, MATECONF_SOUND_DIR, MATECONF_CLIENT_PRELOAD_NONE, error);
- succ = !error || !*error;
-
- if (!error) {
- manager->priv->mateconf_notify = mateconf_client_notify_add (client, MATECONF_SOUND_DIR, (MateConfClientNotifyFunc) mateconf_client_notify_cb, manager, NULL, error);
- succ = !error || !*error;
- }
-
- g_object_unref (client);
-
- return succ;
-}
-
static void
file_monitor_changed_cb (GFileMonitor *monitor,
GFile *file,
@@ -291,7 +269,9 @@ msd_sound_manager_start (MsdSoundManager *manager,
#ifdef HAVE_PULSE
/* We listen for change of the selected theme ... */
- register_config_callback (manager, NULL);
+ manager->priv->settings = g_settings_new (MATE_SOUND_SCHEMA);
+
+ g_signal_connect (manager->priv->settings, "changed", G_CALLBACK (gsettings_notify_cb), manager);
/* ... and we listen to changes of the theme base directories
* in $HOME ...*/
@@ -331,15 +311,9 @@ msd_sound_manager_stop (MsdSoundManager *manager)
g_debug ("Stopping sound manager");
#ifdef HAVE_PULSE
- if (manager->priv->mateconf_notify != 0) {
- MateConfClient *client = mateconf_client_get_default ();
-
- mateconf_client_remove_dir (client, MATECONF_SOUND_DIR, NULL);
-
- mateconf_client_notify_remove (client, manager->priv->mateconf_notify);
- manager->priv->mateconf_notify = 0;
-
- g_object_unref (client);
+ if (manager->priv->settings != NULL) {
+ g_object_unref (manager->priv->settings);
+ manager->priv->settings = NULL;
}
if (manager->priv->timeout) {