summaryrefslogtreecommitdiff
path: root/src/xsettings.c
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2014-05-10 12:42:08 +0200
committerJan Djärv <jan.h.d@swipnet.se>2014-05-10 12:42:08 +0200
commit4a5c71d7c275b93238c629601526a87eca08e6fd (patch)
tree7e71f82e892f87e129a2d9be941b9fd0d5eac8f7 /src/xsettings.c
parent3ebdceafc175e59582caf787696dca2f11a0e495 (diff)
downloademacs-4a5c71d7c275b93238c629601526a87eca08e6fd.tar.gz
* xsettings.c (init_gsettings): Use g_settings_schema_source_lookup
instead of deprecated g_settings_list_schemas if possible. Fixes: debbugs:17434
Diffstat (limited to 'src/xsettings.c')
-rw-r--r--src/xsettings.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/xsettings.c b/src/xsettings.c
index 844da19f638..5f4275df545 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -795,17 +795,29 @@ init_gsettings (void)
{
#ifdef HAVE_GSETTINGS
GVariant *val;
- const gchar *const *schemas;
int schema_found = 0;
#if ! GLIB_CHECK_VERSION (2, 36, 0)
g_type_init ();
#endif
- schemas = g_settings_list_schemas ();
- if (schemas == NULL) return;
- while (! schema_found && *schemas != NULL)
- schema_found = strcmp (*schemas++, GSETTINGS_SCHEMA) == 0;
+#if GLIB_CHECK_VERSION (2, 32, 0)
+ {
+ GSettingsSchema *sc = g_settings_schema_source_lookup
+ (g_settings_schema_source_get_default (),
+ GSETTINGS_SCHEMA,
+ TRUE);
+ schema_found = sc != NULL;
+ if (sc) g_settings_schema_unref (sc);
+ }
+#else
+ {
+ const gchar *const *schemas = g_settings_list_schemas ();
+ if (schemas == NULL) return;
+ while (! schema_found && *schemas != NULL)
+ schema_found = strcmp (*schemas++, GSETTINGS_SCHEMA) == 0;
+ }
+#endif
if (!schema_found) return;
gsettings_client = g_settings_new (GSETTINGS_SCHEMA);