summaryrefslogtreecommitdiff
path: root/trashapplet
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-11-24 18:25:27 +0100
committerStefano Karapetsas <[email protected]>2012-11-24 18:25:27 +0100
commit6f81f2bfc41ca4c4e3def03c545b92a15e8832dc (patch)
treed5190b1434b4e78fd99ad06d71dedb9119e16fd5 /trashapplet
parent18b437378c338287fec39b2e8f2ec2baf04f8cd1 (diff)
downloadmate-applets-6f81f2bfc41ca4c4e3def03c545b92a15e8832dc.tar.bz2
mate-applets-6f81f2bfc41ca4c4e3def03c545b92a15e8832dc.tar.xz
trashapplet: migrate to gsettings
Diffstat (limited to 'trashapplet')
-rw-r--r--trashapplet/src/Makefile.am4
-rw-r--r--trashapplet/src/trash-empty.c10
-rw-r--r--trashapplet/src/trashapplet.c12
3 files changed, 14 insertions, 12 deletions
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 <mateconf/mateconf-client.h>
#include <gio/gio.h>
#include <glib/gi18n.h>
@@ -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 <glib/gi18n.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
-#include <mateconf/mateconf-client.h>
#include <gio/gio.h>
#include <mate-panel-applet.h>
@@ -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);