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



commit 7d1a8db47edeae5425a1b3cde7c629efb72faffd
Author: Rui Matos <tiagomatos gmail com>
Date:   Sat Nov 29 16:39:34 2014 +0100

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

 panels/sharing/cc-sharing-panel.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)
---
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c
index 3d224c6..5cebb9c 100644
--- a/panels/sharing/cc-sharing-panel.c
+++ b/panels/sharing/cc-sharing-panel.c
@@ -1045,22 +1045,19 @@ static gboolean
 cc_sharing_panel_check_schema_available (CcSharingPanel *self,
                                          const gchar *schema_id)
 {
-  const gchar * const* schema_list;
+  GSettingsSchemaSource *source;
+  GSettingsSchema *schema;
 
-  if (schema_id == NULL)
+  source = g_settings_schema_source_get_default ();
+  if (!source)
     return FALSE;
 
-  schema_list = g_settings_list_schemas ();
-
-  while (*schema_list)
-    {
-      if (g_str_equal (*schema_list, schema_id))
-        return TRUE;
-
-      schema_list++;
-    }
+  schema = g_settings_schema_source_lookup (source, schema_id, TRUE);
+  if (!schema)
+    return FALSE;
 
-  return FALSE;
+  g_settings_schema_unref (schema);
+  return TRUE;
 }
 
 static void


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