(Re:) Next monday will be a tuesday (again)

Aaron J. Seigo aseigo at kde.org
Fri Dec 29 18:17:26 GMT 2006


On Friday 29 December 2006 4:29, Olivier Goffart wrote:
> Le vendredi 29 décembre 2006 01:27, Aaron J. Seigo a écrit :
> > KInstance::iconLoader() has moved to KApplication::iconLoader()
>
> Will it work if plugins have their own icon to put in the application
> toolbar ?

sure. they have access to the kapp pointer like anything else. it does mean 
you need a KApplication, however, which is perhaps slightly less flexible 
than a plain singleton.

> If not, I also thought about
> static KIconLoader::self( KInstance* = KGlobal::instance() );

i originally implemented it this way but then thought "hm. we're essentially 
moving it out of kinstance due to that being in kdecore ... so kapplication 
is the kdeui equivalent." the big issue is that with self() taking a 
parameter, we'd actually have to have a mapping of KIconLoaders to instances 
and be sure to get rid of them when the instance goes away; not really a 
singleton anymore and not particularly clean IMHO.

while porting i've stumbled over several places, such as some kpart, the java 
support in khtml and some of the ioslaves, that access the icon loader but 
seem to want to avoid using kapp-> by setting up and using their own internal 
KInstance. 

the solution i've employed in those circumstances is to simply create their 
own IconLoader instance internally. not a big deal; an extra couple lines of 
code for odd cases that don't want to or can't use kapplication.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

Full time KDE developer sponsored by Trolltech (http://www.trolltech.com)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061229/2f232cbb/attachment.sig>


More information about the kde-core-devel mailing list