KConfig and KConfigBackEnd patch to allow arbitrary number of config files

Adam Treat treat at kde.org
Tue Jul 18 15:31:23 BST 2006


I'll rethink the API names.

On Tuesday 18 July 2006 1:24 am, Simon Hausmann wrote:
> On Sunday 9. July 2006 23:01, Adam Treat wrote:
> > On Sunday 09 July 2006 3:32 pm, Simon Hausmann wrote:
> > > Here's a suggestion for the naming instead of addFileToMergeStack:
> > >
> > > addExtraConfigFile(const QString &fileName);
> > > removeExtraConfigFile(const QString &fileName);
> > > removeAllExtraConfigFiles();
> >
> > If people think this is more descriptive, ok... but I wanted to emphasize
> > the nature of the stack (LIFO) so people don't get confused which file is
> > most descriptive of the settings.
>
> If you want to stress the order you could perhaps make it a set/get pair
> that takes a QStringList instead of add/remove. Other than that I think
> it's common to have the order of calls matter, if it is documented.
>
> When reading code using this API three months later I think it is much more
> important to understand that additional configuration files are added to
> the KConfig object to represent than the order of how their keys are
> merged. Especially since in the code that you're reading the order is
> already defined.
>
> KConfig is not about stacking config files, it is primarily about
> representing them in C++. The merging is an extra feature, transparently on
> top, for system administrators and users. That's why I think
> addFileToMergeStack is the wrong name.
>
> Simon




More information about the kde-core-devel mailing list