KConfigXT singleton pointer mess

Andreas Pakulat apaku at gmx.de
Mon Jun 1 22:08:43 UTC 2009


On 01.06.09 19:45:23, Milian Wolff wrote:
> Over the weekend I made the php-docs plugin in playground configurable (i.e. 
> the location to the php documentation) and had a look at 
> kdevelop/tools/coverage as inspiration. It uses KConfigXT to generate a 
> KConfigSkeleton singleton which apparently uses some K_GLOBAL_STATIC magic I'm 
> not acquainted with.
> 
> Well, basic configuration and such works fine, the problem is that for changes 
> to take affect I have to restart KDevelop. Why? Because it looks like the 
> documentation plugin got a different KConfigSkeleton pointer (via self() 
> singleton) than the configuration!
> 
> I really don't know how to fix that... I bet its something I do wrong in the 
> CMakeLists.txt, i.e. the linking...
> 
> $ make -B                                                                                                                    
> makeobj[0]: Entering directory `/home/milian/projects/.build/kde4/php-docs'                                                                                      
> [ 10%] [ 20%] Generating ui_phpdocsconfig.h                                                                                                                      
> Generating phpdocssettings.h, phpdocssettings.cpp                                                                                                                
> [ 30%] Generating phpdocssettings.h, phpdocssettings.cpp
> ...
> 
> I.e. phpdocssettings.* is generated twice. Could this be the issue? But then 
> they are both generated in the same folder and hence should overwrite 
> themselves...
> 
> Or is it simply that I add the kcfg files to both targets (i.e. the 
> documentation plugin and its settings plugin)? Do I have to build that as a 
> shared library target or something? Can't this be done any simpler?!

Well, I think your "error" is to use the KConfigSkeleton for reading out
the values. That class (AFAIK) really is just for connecint entries from a
config file to some gui components in an easy way. Reading should simply be
done by using Project::projectConfiguration().

And additionally the things I've send as answer to the commit-message apply
of course (had read that one before this mail, sorry).

Andreas

-- 
Everything will be just tickety-boo today.




More information about the KDevelop-devel mailing list