[PATCH] Cache returned KIconLoader pixmaps in 4.5.2

Matthias Fuchs mat69 at gmx.net
Wed Sep 15 08:50:44 BST 2010


Am Dienstag 14 September 2010, 04:36:53 schrieb Michael Pyne:
> On Monday, September 13, 2010 20:37:11 Ingo Klöcker wrote:
> > Maybe not, but something like
> > 
> >   QString("%1_%2_%3").arg(name).arg(size).arg(overlays.join("_"))
> > 
> > is completely braindead because it's horribly slow.
> > 
> > What about
> > 
> >   return ( group == KIconLoader::User ? QLatin1Literal("$kicou_") :
> > QLatin1Literal("$kico_") ) % name
> > 
> >          % QLatin1Char('_')
> >          % QString::number(size)
> >          % QLatin1Char('_')
> >          % overlays.join("_")
> > 
> >          % ( group >= 0 ? mpEffect.fingerprint(group, state) :
> > QString("noeffect") ); ?
> 
> I actually didn't know about QStringBuilder, so thanks for introducing me
> to that and the new operator% for QString that it magically enables.

Well it is pretty new (Qt 4.6, not sure what KDE 4.5 depends on) and I just 
stumbled over it when looking at the QString docs once. ;)
It is nice to have a way of speeding things up a little with such ease.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100915/09f5a5f2/attachment.sig>


More information about the kde-core-devel mailing list