[gnome-control-center] search: Drop deprecated API usage



commit d3b6add75e72ac42ddc603248718ea1cd59bd068
Author: Rui Matos <tiagomatos gmail com>
Date:   Sat Nov 29 16:23:18 2014 +0100

    search: Drop deprecated API usage
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740986

 panels/search/cc-search-locations-dialog.c |   26 +++++++++++---------------
 1 files changed, 11 insertions(+), 15 deletions(-)
---
diff --git a/panels/search/cc-search-locations-dialog.c b/panels/search/cc-search-locations-dialog.c
index e06103b..8d2aec1 100644
--- a/panels/search/cc-search-locations-dialog.c
+++ b/panels/search/cc-search-locations-dialog.c
@@ -761,21 +761,17 @@ cc_search_locations_dialog_new (CcSearchPanel *self)
 gboolean
 cc_search_locations_dialog_is_available (void)
 {
-  const gchar * const *schemas;
-  const gchar *schema;
-  gint idx;
-  gboolean found = FALSE;
+  GSettingsSchemaSource *source;
+  GSettingsSchema *schema;
 
-  schemas = g_settings_list_schemas ();
-  for (idx = 0; schemas[idx] != NULL; idx++)
-    {
-      schema = schemas[idx];
-      if (g_strcmp0 (schema, TRACKER_SCHEMA) == 0)
-        {
-          found = TRUE;
-          break;
-        }
-    }
+  source = g_settings_schema_source_get_default ();
+  if (!source)
+    return FALSE;
 
-  return found;
+  schema = g_settings_schema_source_lookup (source, TRACKER_SCHEMA, TRUE);
+  if (!schema)
+    return FALSE;
+
+  g_settings_schema_unref (schema);
+  return TRUE;
 }


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