strange KStaticDeleter usage

David Faure faure at kde.org
Thu Apr 26 00:27:12 BST 2007


On Sunday 22 April 2007, Thiago Macieira wrote:
> Christian Ehrlicher wrote:
> >Sometimes there is also a dtor where s_self is set to 0 (when s_self ==
> >this).
> >I don't think this can work, but also don't know how to replace this
> >with K_GLOBAL_STATIC in an easy and clean way.
> 
> I think the code is broken the way it is.

Well no it's not broken, it works fine and this mechanism is used in other places (e.g. kpixmapprovider iirc).

This is a hook for applications like kontact, which can reimplement the behavior. 
kontact creates and instanciates a derived class, which sets it as the singleton instead of the kdelibs one,
and everything goes through it instead of using the default implementation from kdelibs.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list