DConf configuration system

Sean Middleditch elanthis at awesomeplay.com
Wed Apr 6 21:00:13 EEST 2005

On Wed, 2005-04-06 at 13:28 -0400, Avery Pennarun wrote:
> On Wed, Apr 06, 2005 at 11:18:23AM -0400, Sean Middleditch wrote:
> > Why should it have folders and all that?  It really shouldn't be
> > anything more than a key/value database.  The keys might look something
> > like UNIX paths, but that doesn't mean they are - the engine doesn't
> > need to specially recognize the / character or anything.  Making it
> > actually folder-based doesn't buy you anything, but it could potentially
> > complicate backend code.
> > 
> > Instead of setting properties like access privileges and such per folder
> > or per key, you could do it using patterns.  For example, a rule in the
> > system configuration could state something like:
> >   # admin can edit panel config, users cannot
> >   /app/gnome/panel/*: root(rw),*(ro)
> > That then would just be something compared with any keys using fnmatch
> > (or something similar).
> Unfortunately this won't work, because it doesn't let you do non-recursive
> iteration through the tree.  As the simplest example, imagine I'm building
> an app like gconf-editor, and my config tree contains only 10 toplevel
> folders but 100000 keys (not an unreasonable number, unfortunately, which I
> am quickly learning as UniConf becomes more popular).
> How do I use a wildcard match to say "give me only the list of toplevel
> folders" so I can navigate the tree incrementally?  You could do it with a
> regex, but having the backend actually *implement* the regex would require
> it to linearly search the complete set of 100000 keys... unless someone has
> invented a "regex hashtable" algorithm or something I haven't heard about.

Hmm, would it really be a problem for such an app (which would not be
used very often at all by normal desktop users) to just grab all the
keys?  If it is a real performance killer (I'll trust your experience in
this), then that would make "folders" necessary.  With a real defined
need, I have no further objections to them.  :)
Sean Middleditch <elanthis at awesomeplay.com>

More information about the xdg mailing list