[gthumb] removed use of g_settings_list_schemas



commit 08313baaed0be707d45ebea64907abcc8c86cf8c
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Apr 15 11:55:54 2014 +0200

    removed use of g_settings_list_schemas

 gthumb/glib-utils.c |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)
---
diff --git a/gthumb/glib-utils.c b/gthumb/glib-utils.c
index e639078..c792979 100644
--- a/gthumb/glib-utils.c
+++ b/gthumb/glib-utils.c
@@ -3071,24 +3071,19 @@ _g_settings_get_string_list (GSettings  *settings,
 
 
 GSettings *
-_g_settings_new_if_schema_installed (const char *schema_name)
+_g_settings_new_if_schema_installed (const char *schema_id)
 {
-       GSettings          *settings;
-       const char * const *schemas;
+       GSettingsSchema *schema;
 
-       settings = NULL;
+       schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (),
+                                                 schema_id,
+                                                 TRUE);
+       if (schema == NULL)
+               return NULL;
 
-       for (schemas = g_settings_list_schemas ();
-             *schemas != NULL;
-             schemas++)
-       {
-               if (g_strcmp0 (*schemas, schema_name) == 0) {
-                       settings = g_settings_new (schema_name);
-                       break;
-               }
-        }
+       g_settings_schema_unref (schema);
 
-        return settings;
+       return g_settings_new (schema_id);
 }
 
 


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