KConfig::addConfigSources is broken
Thomas Braxton
kde.braxton at gmail.com
Mon Nov 19 14:28:53 GMT 2007
On 11/19/07, Andreas Pakulat <apaku at gmx.de> wrote:
> On 19.11.07 07:52:07, Thomas Braxton wrote:
> > On 11/19/07, Andreas Pakulat <apaku at gmx.de> wrote:
> > > Bah, I shouldn't code when I'm in a hurry. Of course the second point is
> > > due to a coding error on my side. So only reading from a config object
> > > is a problem.
> > >
> > Try calling reparseConfiguration after addConfigSources,
>
> Ok, though from my PoV it would be good to have that implicitly done by
> addConfigSources. So now everything seems to work with the switching of
> files. So just the api dox need serious improvements.
That can be added
> > without it
> > the files added are never parsed. You should have needed this before
> > the merge, because I'm not seeing where the files are parsed
> > automatically.
>
> I can assure you that it did work at least in April this year (IIRC that
> was the time I worked on kdevelops project config stuff last time).
Where in the code does it parse the added files? Looking at
kconfig.cpp and kconfigbackend.cpp before the merge, it looks like the
files are just added to the merge stack without being parsed.
kconfig.cpp:r717640
QStringList KConfig::extraConfigFiles() const
{
return backEnd()->extraConfigFiles();
}
void KConfig::setExtraConfigFiles(const QStringList &files)
{
backEnd()->setExtraConfigFiles( files );
}
void KConfig::removeAllExtraConfigFiles()
{
backEnd()->removeAllExtraConfigFiles();
}
kconfigbackend.cpp:r715967
QStringList KConfigBackEnd::extraConfigFiles() const
{
return mMergeStack.toList();
}
void KConfigBackEnd::setExtraConfigFiles( const QStringList &files )
{
removeAllExtraConfigFiles();
foreach( const QString &file, files )
mMergeStack.push(file);
}
void KConfigBackEnd::removeAllExtraConfigFiles() { mMergeStack.clear(); }
More information about the kde-core-devel
mailing list