[gnome-settings-daemon] housekeeping: Don't assert if nautilus isn't installed
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] housekeeping: Don't assert if nautilus isn't installed
- Date: Tue, 19 Oct 2010 13:43:51 +0000 (UTC)
commit 7c61db0c3c131933a61e6c14bc893e6b6bc456bb
Author: Bastien Nocera <hadess hadess net>
Date: Tue Oct 19 14:42:10 2010 +0100
housekeeping: Don't assert if nautilus isn't installed
By checking for nautilus' schema being installed.
plugins/housekeeping/gsd-ldsm-trash-empty.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/plugins/housekeeping/gsd-ldsm-trash-empty.c b/plugins/housekeeping/gsd-ldsm-trash-empty.c
index 331503a..d97b96c 100644
--- a/plugins/housekeeping/gsd-ldsm-trash-empty.c
+++ b/plugins/housekeeping/gsd-ldsm-trash-empty.c
@@ -322,12 +322,21 @@ trash_empty_confirmation_response (GtkDialog *dialog,
static gboolean
trash_empty_require_confirmation (void)
{
- GSettings *settings;
gboolean require_confirmation = TRUE;
-
- settings = g_settings_new ("org.gnome.nautilus.preferences");
- require_confirmation = g_settings_get_boolean (settings, "confirm-trash");
- g_object_unref (settings);
+ const char * const *schemas;
+ guint i;
+
+ schemas = g_settings_list_schemas ();
+ for (i = 0; schemas[i] != NULL; i++) {
+ if (g_str_equal (schemas[i], "org.gnome.nautilus.preferences")) {
+ GSettings *settings;
+
+ settings = g_settings_new ("org.gnome.nautilus.preferences");
+ require_confirmation = g_settings_get_boolean (settings, "confirm-trash");
+ g_object_unref (settings);
+ break;
+ }
+ }
return require_confirmation;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]