[gnome-applets/wip/gnome-3.10+: 12/29] trashapplet: port to GSettings



commit 61010f53b282ecfc2a7a6d66d60f56c9edf5e1eb
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Jul 7 23:39:20 2014 +0300

    trashapplet: port to GSettings

 trashapplet/src/Makefile.am   |    4 +-
 trashapplet/src/trash-empty.c |    9 +-
 trashapplet/src/trashapplet.c |   10 -
 trashapplet/src/xstuff.c      |  524 -----------------------------------------
 trashapplet/src/xstuff.h      |   34 ---
 5 files changed, 6 insertions(+), 575 deletions(-)
---
diff --git a/trashapplet/src/Makefile.am b/trashapplet/src/Makefile.am
index 7b579ea..ddf5b10 100644
--- a/trashapplet/src/Makefile.am
+++ b/trashapplet/src/Makefile.am
@@ -9,9 +9,7 @@ libexec_PROGRAMS = trashapplet
 trashapplet_SOURCES = \
        trashapplet.c \
        trash-empty.h \
-       trash-empty.c \
-       xstuff.c \
-       xstuff.h
+       trash-empty.c
 
 trashapplet_LDADD =            \
        $(GNOME_APPLETS_LIBS)   \
diff --git a/trashapplet/src/trash-empty.c b/trashapplet/src/trash-empty.c
index bb33c5c..d296915 100644
--- a/trashapplet/src/trash-empty.c
+++ b/trashapplet/src/trash-empty.c
@@ -19,7 +19,6 @@
  * 02111-1307, USA.
  */
 
-#include <gconf/gconf-client.h>
 #include <gio/gio.h>
 #include <glib/gi18n.h>
 
@@ -279,9 +278,11 @@ trash_empty_start (GtkWidget *parent)
 static gboolean
 trash_empty_require_confirmation (void)
 {
-  return gconf_client_get_bool (gconf_client_get_default (),
-                                "/apps/nautilus/preferences/confirm_trash",
-                                NULL);
+  GSettings *settings = g_settings_new ("org.gnome.nautilus.preferences");
+  gboolean 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 ec9604a..d1abb24 100644
--- a/trashapplet/src/trashapplet.c
+++ b/trashapplet/src/trashapplet.c
@@ -30,12 +30,10 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
-#include <gconf/gconf-client.h>
 #include <gio/gio.h>
 #include <panel-applet.h>
 
 #include "trash-empty.h"
-#include "xstuff.h"
 
 typedef PanelAppletClass TrashAppletClass;
 
@@ -240,22 +238,14 @@ trash_applet_init (TrashApplet *applet)
   trash_applet_monitor_changed (applet);
 }
 
-#define PANEL_ENABLE_ANIMATIONS "/apps/panel/global/enable_animations"
 static gboolean
 trash_applet_button_release (GtkWidget      *widget,
                              GdkEventButton *event)
 {
   TrashApplet *applet = TRASH_APPLET (widget);
-  static GConfClient *client;
-
-  if (client == NULL)
-    client = gconf_client_get_default ();
 
   if (event->button == 1)
     {
-      if (gconf_client_get_bool (client, PANEL_ENABLE_ANIMATIONS, NULL))
-        xstuff_zoom_animate (widget, NULL);
-
       trash_applet_open_folder (NULL, NULL, applet);
 
       return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]