>IMO you can also solve this with stackable databases, as used inSorry, I meant stackable databases as used in bonobo-config.
bonobo-config.Not really. Stackable databases (as used also in GConf ;) are not the
solution to the problem below; each database in the stack has an
identical namespace.
The configuration context I described below provides a list ofSo please let me explain the concept I use in bonobo-config. It is quite easy and part of the ConfigDatabase interface:
base addresses that define a logically stacked namespace
that may be resolved within a single database or across multiple
(stacked or composed) databases.
/** * addDatabase: * * The added database will be used to lookup default values. */ void addDatabase (in ConfigDatabase default_db, in string path) raises (BackendFailed);That is all you need. Maybe it is best to use the user_level as example. The user level is a global configuration key, but some application wants to implement there own meaning. So we have two keys:
/global/shared/settings/user_level
/application/gnumeric/shared/user_level
The application uses the following code to access the database:
defaultdb = bonobo_get_object ("config:/global/shared/settings", "Bonobo/ConfigDatabase"); db = bonobo_get_object ("config:/application/gnumeric", "Bonobo/ConfigDatabase"); Bonobo_ConfigDatabase_addDatabase (db, defaultdb, "shared");You can now get/set the user_level with:
bonobo_pbclient_get_long (db, "/shared/user_level", NULL); bonobo_pbclient_set_long (db, "/shared/user_level", 1, NULL);I think this is a nice solution to your problem.
- Dietmar