Switch to a new approach for using GSettings
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.
parent
9a327235
Please register or sign in to comment