summaryrefslogtreecommitdiff
path: root/libmate-desktop
diff options
context:
space:
mode:
Diffstat (limited to 'libmate-desktop')
-rw-r--r--libmate-desktop/mate-gsettings.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libmate-desktop/mate-gsettings.c b/libmate-desktop/mate-gsettings.c
index e37bc91..8f20e98 100644
--- a/libmate-desktop/mate-gsettings.c
+++ b/libmate-desktop/mate-gsettings.c
@@ -37,10 +37,22 @@
gboolean
mate_gsettings_schema_exists (const gchar* schema)
{
+#if GLIB_CHECK_VERSION (2, 40, 0)
+ GSettingsSchemaSource *schema_source;
+ GSettingsSchema *schema_schema;
+#else
const char * const *schemas;
- gboolean schema_exists;
gint i;
+#endif
+ gboolean schema_exists;
+#if GLIB_CHECK_VERSION (2, 40, 0)
+ schema_source = g_settings_schema_source_get_default();
+ schema_schema = g_settings_schema_source_lookup (schema_source, schema, FALSE);
+ schema_exists = (schema_schema != NULL);
+ if (schema_schema)
+ g_settings_schema_unref (schema_schema);
+#else
schemas = g_settings_list_schemas ();
schema_exists = FALSE;
@@ -50,6 +62,7 @@ mate_gsettings_schema_exists (const gchar* schema)
break;
}
}
+#endif
return schema_exists;
}