From 6f81f2bfc41ca4c4e3def03c545b92a15e8832dc Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Sat, 24 Nov 2012 18:25:27 +0100 Subject: trashapplet: migrate to gsettings --- trashapplet/src/Makefile.am | 4 ++-- trashapplet/src/trash-empty.c | 10 ++++++---- trashapplet/src/trashapplet.c | 12 ++++++------ 3 files changed, 14 insertions(+), 12 deletions(-) (limited to 'trashapplet/src') diff --git a/trashapplet/src/Makefile.am b/trashapplet/src/Makefile.am index b7d6a655..36a536ce 100644 --- a/trashapplet/src/Makefile.am +++ b/trashapplet/src/Makefile.am @@ -1,5 +1,5 @@ INCLUDES = -I$(top_srcdir) \ - $(MATE_APPLETS3_CFLAGS) \ + $(MATE_APPLETS4_CFLAGS) \ $(GIO_CFLAGS) \ -DTRASH_MENU_UI_DIR=\""$(datadir)/mate-2.0/ui"\" @@ -13,7 +13,7 @@ trashapplet_SOURCES = \ xstuff.h trashapplet_LDADD = \ - $(MATE_APPLETS3_LIBS) \ + $(MATE_APPLETS4_LIBS) \ $(GIO_LIBS) \ -lX11 diff --git a/trashapplet/src/trash-empty.c b/trashapplet/src/trash-empty.c index bff97460..16b39191 100644 --- a/trashapplet/src/trash-empty.c +++ b/trashapplet/src/trash-empty.c @@ -19,7 +19,6 @@ * 02110-1301, USA. */ -#include #include #include @@ -287,9 +286,12 @@ trash_empty_start (GtkWidget *parent) static gboolean trash_empty_require_confirmation (void) { - return mateconf_client_get_bool (mateconf_client_get_default (), - "/apps/caja/preferences/confirm_trash", - NULL); + gboolean confirm_trash; + GSettings *settings; + settings = g_settings_new ("org.mate.caja.preferences"); + confirm_trash = g_settings_get_boolean (settings, "confirm-trash"); + g_object_unref (settings); + return confirm_trash; } static void diff --git a/trashapplet/src/trashapplet.c b/trashapplet/src/trashapplet.c index 0edf9f74..6fc5b366 100644 --- a/trashapplet/src/trashapplet.c +++ b/trashapplet/src/trashapplet.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -244,20 +243,21 @@ trash_applet_init (TrashApplet *applet) trash_applet_monitor_changed (applet); } -#define PANEL_ENABLE_ANIMATIONS "/apps/panel/global/enable_animations" +#define PANEL_SCHEMA "org.mate.panel" +#define PANEL_ENABLE_ANIMATIONS "enable-animations" static gboolean trash_applet_button_release (GtkWidget *widget, GdkEventButton *event) { TrashApplet *applet = TRASH_APPLET (widget); - static MateConfClient *client; + static GSettings *settings; - if (client == NULL) - client = mateconf_client_get_default (); + if (settings == NULL) + settings = g_settings_new (PANEL_SCHEMA); if (event->button == 1) { - if (mateconf_client_get_bool (client, PANEL_ENABLE_ANIMATIONS, NULL)) + if (g_settings_get_boolean (settings, PANEL_ENABLE_ANIMATIONS)) xstuff_zoom_animate (widget, NULL); trash_applet_open_folder (NULL, applet); -- cgit v1.2.1