Instead of building a reversed linked list by prepending in order and
then reversing it at the end, prepend in reverse by iterating backwards
through the directories (to get a list in-order when we're done).
These functions no longer have anything to do with GSettings itself, so
they should not be in that file anymore.
GSettings still wants direct access to the GSettingsSchemaKey structure,
so put that one in gsettingsschema-internal.h.
This reverts commit c841c2ce3f.
This approach has been an unmitigated disaster. We're getting all sorts
of crashes due to functions that are returning NULL because they can't
find the schema for the default value. The people who get these crashes
are then confused about the root cause of the problem and waste a lot of
time trying to figure it out.
Until we find a better solution, we should go back to what we had
before.
https://bugzilla.gnome.org/show_bug.cgi?id=655366
GVDB deals with empty lists by returning NULL for the list instead of a
zero-length (non-NULL) strv. We can work around that in GSettingsSchema
by checking for the NULL case and treating it like a zero-length list.
https://bugzilla.gnome.org/show_bug.cgi?id=660147
GSettings relies on parts of the schema infromation remaining
unbyteswapped (the strinfo database, for example) while requiring other
parts to be in native order (the default value, constraints, etc.).
Lift the byteswapping into a place where we can do it selectively.
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().
gvdb just dropped the ability to have a separate "options" field. We
now store the options into a GVariant along with the default value.
For now, we use a small shim in GSettingsSchema in order not to touch
too much code. A more complete rewrite will follow.
This represents a change to the schema file format with another likely
to follow. glib-compile-schemas needs to be re-run after installing
this change.