[gnome-builder/wip/plugins] egg-settings-sandwich: don't use deprecated GSettings API



commit a04443d3af5f0a799a35e2cf4eda25ef8805bbbb
Author: Christian Hergert <christian hergert me>
Date:   Thu Jun 11 14:28:41 2015 -0700

    egg-settings-sandwich: don't use deprecated GSettings API
    
    g_settings_list_keys() was recently deprecated, so lets switch to use
    the new API on the settings schema directly. Doesn't make too much of
    a difference here in performance, since we'd have to load the settings
    anyway.

 contrib/egg/egg-settings-sandwich.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/contrib/egg/egg-settings-sandwich.c b/contrib/egg/egg-settings-sandwich.c
index a1aba9c..0e16d84 100644
--- a/contrib/egg/egg-settings-sandwich.c
+++ b/contrib/egg/egg-settings-sandwich.c
@@ -92,14 +92,28 @@ egg_settings_sandwich_cache_key (EggSettingsSandwich *self,
 static void
 egg_settings_sandwich_update_cache (EggSettingsSandwich *self)
 {
+  GSettingsSchemaSource *source;
+  GSettingsSchema *schema;
   gchar **keys;
   gsize i;
 
   g_assert (EGG_IS_SETTINGS_SANDWICH (self));
 
-  keys = g_settings_list_keys (self->memory_settings);
+  source = g_settings_schema_source_get_default ();
+  schema = g_settings_schema_source_lookup (source, self->schema_id, TRUE);
+
+  if (schema == NULL)
+    {
+      g_error ("Failed to locate schema: %s", self->schema_id);
+      return;
+    }
+
+  keys = g_settings_schema_list_keys (schema);
+
   for (i = 0; keys [i]; i++)
     egg_settings_sandwich_cache_key (self, keys [i]);
+
+  g_object_unref (schema);
   g_strfreev (keys);
 }
 


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