KConfig and KConfigBackEnd patch to allow arbitrary number of config files
Adam Treat
treat at kde.org
Sun Jul 9 20:17:24 BST 2006
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
3. $PROJECTDIR/$PROJECTNAME.kdev4
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 :)
Adam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kconfig_merge_stack.diff
Type: text/x-diff
Size: 12918 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060709/d0ced442/attachment.diff>
More information about the kde-core-devel
mailing list