[gnome-settings-daemon] Use GSettings for Nautilus' confirm-trash option



commit b7bfc8d962cbf08e67184142dda42b2bc425f1d6
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Tue Oct 19 12:50:56 2010 +0200

    Use GSettings for Nautilus' confirm-trash option

 plugins/housekeeping/gsd-ldsm-trash-empty.c |   22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)
---
diff --git a/plugins/housekeeping/gsd-ldsm-trash-empty.c b/plugins/housekeeping/gsd-ldsm-trash-empty.c
index d0ff32e..331503a 100644
--- a/plugins/housekeeping/gsd-ldsm-trash-empty.c
+++ b/plugins/housekeeping/gsd-ldsm-trash-empty.c
@@ -18,14 +18,11 @@
  * with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <gconf/gconf-client.h>
 #include <glib/gi18n.h>
 #include <gio/gio.h>
 
 #include "gsd-ldsm-trash-empty.h"
 
-#define NAUTILUS_CONFIRM_TRASH_KEY "/apps/nautilus/preferences/confirm_trash"
-
 /* Some of this code has been borrowed from the trash-applet, courtesy of Ryan Lortie */
 
 static GtkWidget *trash_empty_confirm_dialog = NULL;
@@ -325,21 +322,12 @@ trash_empty_confirmation_response (GtkDialog *dialog,
 static gboolean
 trash_empty_require_confirmation (void)
 {
-        GConfClient *client;
+        GSettings *settings;
         gboolean require_confirmation = TRUE;
-        GError *error = NULL;
-
-        client = gconf_client_get_default ();
-        if (client) {
-                require_confirmation = gconf_client_get_bool (client, NAUTILUS_CONFIRM_TRASH_KEY, &error);
-                if (error) {
-                        g_warning ("Failed to read confirm_trash key from GConf: %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 ("org.gnome.nautilus.preferences");
+        require_confirmation = g_settings_get_boolean (settings, "confirm-trash");
+        g_object_unref (settings);
 
         return require_confirmation;
 }



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