Fixed bug in KisPerChannelFilter that prevented it from loading/saving bookmarks v.3

Cyrille Berger cberger at cberger.net
Tue Mar 10 09:03:59 CET 2009


On Monday 09 March 2009, Dmitry Kazakov wrote:
> > > KisFilter d->parentFilter;
> > >
> > > KisSerializableConfiguration*
> > > KisFilterConfigurationFactory::createDefault() {
> > > return d->parentFilter->defaultConfiguration;
> > > }
> > >
> > > Is it?
> >
> > almost, with return d->parentFilter->factoryConfiguration(); instead :)
>
> In such a case we miss loading of the default configuration from kritarc.
> So return d->parentFilter->defaultConfiguration(); instead :P
No we don't, since the factory is mainly used by the bookmark manager when 
reading from kritarc, and by using d->parentFilter->defaultConfiguration(); we 
create an infinite loop, since:
defaultConfiguration() calls the bookmarkmanager which call the createDefault() 
from factory which calls defaultConfiguration() which calls the bookmarkmanager 
which call the createDefault() from factory which calls defaultConfiguration() 
which....

KisBaseProcessor::defaultConfiguration() is a convenient function supposed to 
return by order of preference:
1) the default as set by the user (from the bookmarkmanager)
2) the last used configuration (from the bookmarkmanager)
3) call factoryConfiguration() if all the above have fails

Not sure why it's marked as virtual. And it should probably not be so, since 
there is no reason to overwrite it, and no filter does that currently, so 
probably a good idea to make it non virtual.

-- 
Cyrille Berger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20090310/f9070120/attachment-0001.htm 


More information about the kimageshop mailing list