KConfig and KConfigBackEnd patch to allow arbitrary number of config files

Simon Hausmann hausmann at kde.org
Sun Jul 9 20:32:07 BST 2006

On Sunday 9. July 2006 21:17, Adam Treat wrote:
> Hey All,
> The patch allows us add arbitrary number of config files to the global
> KConfig object in KDevelop...  With this we can have the following config
> files for a kdevelop4 instance:
> 1. $KDEINSTALL/share/config/kdeveloprc|kdeglobals
> 2. $USER/.kde/share/config/kdeveloprc
> 4. $PROJECTDIR/.kdev4/$PROJECTNAME.kdev4
> The most specific file would be #3 and #4... depending upon the particular
> setting we're talking about.
> This will give us seemless configuration options throughout.  In other
> words, we can specify per project values for every setting that kdevelop4
> offers. And if we take special care to make sure hard paths and such go in
> the hidden directory... we can pass around project files :)
> Please review the patch carefully.  It works for me when I add calls
> like...
> m_config->config()->addFileToMergeStack(
> "/home/kde/trunk/KDE/kdevelop/global.kdev4" );
> m_config->config()->addFileToMergeStack(
> "/home/kde/trunk/KDE/kdevelop/.kdevelop/local.kdev4" );
> ... in kdevelop's new kdevcmodule.cpp constructor.
> The idea is to have ONE global configuration dialog that will have
> different modes depending upon when you open it.  If you open it without a
> project loaded it will write to #2.  If you open it with a project loaded
> it will change the top level menu item from 'Configure KDevelop' to
> 'Configure Project' and will write to #3 and #4.
> Plugin writers won't have to worry about any of that as it will be done
> automatically by the kdevelop framework and KConfigXT.  Just write your
> KDevCModule and you're done.
> Once committed, I'll go ahead and hook this up to the project loading and
> we'll be in business :)

Here's a suggestion for the naming instead of addFileToMergeStack:

addExtraConfigFile(const QString &fileName);
removeExtraConfigFile(const QString &fileName);

-------------- 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/20060709/845eea7f/attachment.sig>

More information about the kde-core-devel mailing list