From 0c53acf555da0386c5089cbd0db59dc3e5bb0a6a Mon Sep 17 00:00:00 2001 From: infirit Date: Tue, 16 Dec 2014 00:11:52 +0100 Subject: mate-screenshot: Do not use g_settings_list_schemas --- mate-screenshot/mate-screenshot.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'mate-screenshot') diff --git a/mate-screenshot/mate-screenshot.c b/mate-screenshot/mate-screenshot.c index 0e122b47..03b23e54 100644 --- a/mate-screenshot/mate-screenshot.c +++ b/mate-screenshot/mate-screenshot.c @@ -1122,26 +1122,21 @@ get_desktop_dir (void) { gboolean desktop_is_home_dir = FALSE; gchar *desktop_dir; - const char * const *schemas; gboolean schema_exists = FALSE; - gint i; /* Check if caja schema is installed before trying to read settings */ - schemas = g_settings_list_schemas (); - for (i = 0; schemas[i] != NULL; i++) { - if (g_strcmp0 (schemas[i], CAJA_PREFERENCES_SCHEMA) == 0) { - schema_exists = TRUE; - break; - } - } + GSettingsSchema *schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (), + CAJA_PREFERENCES_SCHEMA, + FALSE); - if (schema_exists) { + if (schema != NULL) { GSettings *caja_prefs; caja_prefs = g_settings_new (CAJA_PREFERENCES_SCHEMA); desktop_is_home_dir = g_settings_get_boolean (caja_prefs, "desktop-is-home-dir"); g_object_unref (caja_prefs); + g_settings_schema_unref (schema); } if (desktop_is_home_dir) -- cgit v1.2.1