Open
Conversation
With GSettings, every setting item must correspond to a predefined schema. As we were quite liberal in our use of configuration entries, this causes some challenges. So this commits introduces a new approach, based on a few principles: * Schema definition is maintained manually * Everything is relocatable * Path structure must match schema id In GSettings, a schema normally has a fixed path that determines where the settings are stored in the global tree of settings. However, schemas can also be 'relocatable', i.e. not equipped with a fixed path. We need to use relocatable schemas quite a lot. For example, each source has its own set of preferences, located under a node that is the unique identifier of the source. And the set of possible sources is unknown: one for each DAP device, each DAAP server, etc. So instead of trying to figure out which schema is relocatable, we just assume all of them are. Preferences are accessed by their namespace, which is converted to a path. Then we try to find an existing schema id by assuming they have the same structure, and going up the tree until we find a match. So for example, the path /org/gnome/banshee/sources/Foo/Bar will correspond to the schema with the id org.gnome.banshee.sources This means that preferences must always have a path that matches their schema id. Automatically extracting the schema from the code will not work without major impact on everything using preferences: we can't figure out both the schema id and the path without those notions leaking out everywhere in the code base. So I just used the GSettingsSchemaExtractor to get a first rough cut of the schema, and edited it manually to add all the keys that were not extracted automatically. Missing keys are easy to find, as GSettings just aborts when trying to read a key not defined in the schema. That means that the GSettingsSchemaExtractor are the related infrastructure can be removed. The build system is also modified so that the schema file gets translated and included in the source tarball. Also updated Hyena to bring in the latest git master which doesn't reference GConf at all anymore.
We're keeping the old preferences definitions, so that the migration path can still potentially work.
9bfde4e to
8161b8e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Will resolve #15, eventually...