KInstance and KIconLoader

Reinhold Kainhofer reinhold at kainhofer.com
Mon Dec 11 16:13:01 GMT 2006


Am Montag, 11. Dezember 2006 15:34 schrieb David Faure:
> I guess the better solution (but which involves more work) is to move all
> logic to KIconLoaderPrivate and have a <instance,loaderprivate> qmap, so
> that "KIconLoader iconLoader(instance)" reuses an existing private backend;
> then creating iconloaders is cheap and there's no need for factory methods.
>
> The problem in all cases is also that the qmap would keep old deleted
> instances... (and we can't turn kinstance into a qobject since kapp
> multiply derives from qapp+kinstance).

How about adding observers to KInstance? In the destructor you would call a 
method of all registered observers, one of them being a method that removes 
the pointer from the map. That observer would of course only be registered 
with the KInstance when the icon loader is actually created and inserted into 
the map.

Cheers,
Reinhold

-- 
------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: reinhold at kainhofer.com, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/




More information about the kde-core-devel mailing list