From d2c7965aa092cecb857bd0301b7c9ff2dc10f9f8 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Mon, 1 Oct 2012 22:58:54 +0200 Subject: migrate to gsettings --- plugins/housekeeping/msd-ldsm-trash-empty.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'plugins/housekeeping/msd-ldsm-trash-empty.c') diff --git a/plugins/housekeeping/msd-ldsm-trash-empty.c b/plugins/housekeeping/msd-ldsm-trash-empty.c index 05f82cd..e218d6d 100644 --- a/plugins/housekeeping/msd-ldsm-trash-empty.c +++ b/plugins/housekeeping/msd-ldsm-trash-empty.c @@ -18,13 +18,14 @@ * with this program. If not, see . */ -#include +#include #include #include #include "msd-ldsm-trash-empty.h" -#define CAJA_CONFIRM_TRASH_KEY "/apps/caja/preferences/confirm_trash" +#define CAJA_PREFS_SCHEMA "org.mate.caja.preferences" +#define CAJA_CONFIRM_TRASH_KEY "confirm-trash" /* Some of this code has been borrowed from the trash-applet, courtesy of Ryan Lortie */ @@ -325,21 +326,12 @@ trash_empty_confirmation_response (GtkDialog *dialog, static gboolean trash_empty_require_confirmation () { - MateConfClient *client; + GSettings *settings; gboolean require_confirmation = TRUE; - GError *error = NULL; - - client = mateconf_client_get_default (); - if (client) { - require_confirmation = mateconf_client_get_bool (client, CAJA_CONFIRM_TRASH_KEY, &error); - if (error) { - g_warning ("Failed to read confirm_trash key from MateConf: %s", error->message ? error->message : "Unknown error"); - /* It's safest to assume that confirmation is required here */ - require_confirmation = TRUE; - g_error_free (error); - } - g_object_unref (client); - } + + settings = g_settings_new (CAJA_PREFS_SCHEMA); + require_confirmation = g_settings_get_boolean (settings, CAJA_CONFIRM_TRASH_KEY); + g_object_unref (settings); return require_confirmation; } -- cgit v1.2.1