diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2018-05-17 15:44:05 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2018-05-17 15:44:05 +0100 |
commit | a73b0506e6c2ba889aea3776856c034379a1a3c8 (patch) | |
tree | 04c3820b0ac7428a629ca8a32c00012b2d82f37e | |
parent | 9ce84f15aa84380fe1aec2242a2e022a11f42657 (diff) | |
download | at-spi2-core-a73b0506e6c2ba889aea3776856c034379a1a3c8.tar.gz |
Do not use deprecated GSettings API
If the version of GIO is new enough, we should use the non-deprecated
way to conditionally create a GSettings instance.
-rw-r--r-- | bus/at-spi-bus-launcher.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 69f63e73..5d58dff8 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -814,6 +814,15 @@ already_running () static GSettings * get_schema (const gchar *name) { +#if GLIB_CHECK_VERSION (2, 32, 0) + GSettingsSchemaSource *source = g_settings_schema_source_get_default (); + GSettingsSchema *schema = g_settings_schema_source_lookup (source, name, FALSE); + + if (schema == NULL) + return NULL; + + return g_settings_new_full (schema, NULL, NULL); +#else const char * const *schemas = NULL; gint i; @@ -825,6 +834,7 @@ get_schema (const gchar *name) } return NULL; +#endif } static void |