KConfig and KConfigBackEnd patch to allow arbitrary number of config files

Simon Hausmann hausmann at kde.org
Tue Jul 18 06:24:08 BST 2006

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 

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060718/59b6abdd/attachment.sig>

More information about the kde-core-devel mailing list