Clean up g_settings_list_schemas()

In its previous form, g_settings_list_schemas() was not useful as a tool
to prevent aborts due to using g_settings_new() with an invalid schema
name.  This is because g_settings_list_scheams() also listed relocatable
schemas, and calling g_settings_new() for those would abort just the
same as if you called it for a non-existent schema.

Modify g_settings_list_schemas() so that it only returns schemas for
which it is safe to call g_settings_new().  Add another call for sake of
completeness: g_settings_list_relocatable_schemas().
This commit is contained in:
Ryan Lortie
2010-10-02 22:42:02 -04:00
parent 1fee36f72b
commit d2c0699440
4 changed files with 103 additions and 32 deletions

View File

@@ -71,6 +71,7 @@ struct _GSettings
GType g_settings_get_type (void);
const gchar * const * g_settings_list_schemas (void);
const gchar * const * g_settings_list_relocatable_schemas (void);
GSettings * g_settings_new (const gchar *schema);
GSettings * g_settings_new_with_path (const gchar *schema,
const gchar *path);