[at-spi2-core] Do not use deprecated GSettings API



commit a73b0506e6c2ba889aea3776856c034379a1a3c8
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu May 17 15:44:05 2018 +0100

    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.

 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 69f63e7..5d58dff 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]