KConfigSkeleton::usrWriteConfig()

Cornelius Schumacher schumacher at kde.org
Sun Apr 22 12:35:27 BST 2007


On Sunday 22 April 2007 13:00, Andreas Pakulat wrote:
> On 22.04.07 12:21:12, Cornelius Schumacher wrote:
> > This commit
> >
> > http://websvn.kde.org/trunk/KDE/kdelibs/kdeui/config/kconfigskeleton.cpp?
> >r1=559982&r2=560326
> >
> > moved the code to write KConfigSkeleton's configuration data from the
> > writeConfig() function to the virtual usrWriteConfig() function. This
> > broke all applications which overwrote usrWriteConfig(), e.g. KOrganizer.
> >
> > Is there any reason why this was done?
>
> Thats in the commit message, the reason is to be able to completely
> replace the logic that was formerly in writeConfig. And this is needed
> at least in KDevelop4.

Why? What is KDevelop doing there?

In my opinion replacing the logic and extending it are two different things. 
If both is required we should have different hooks.

> > The usrWriteConfig() function was
> > supposed to be a hook for customizations, not a function doing vital
> > stuff. Any objections to reverting that change?
>
> Yes, as Thomas already said you can just call the base class
> implementation and be done with it.

Sure, but there are several problems with that. First is that an unknown 
number of applications is now broken which relied on the previous behavior. 
Second this is a cause for subtle errors as it's easy to forget or not know 
in the first place, that a reimplementation has to call the base class 
implementation there, especially as it's not documented. Third, as I said 
above, it's mixing different needs and concepts, so the API is less 
straightforward now.

-- 
Cornelius Schumacher <schumacher at kde.org>




More information about the kde-core-devel mailing list