Use QPixmapCache for KStandardItemListWidget::pixmapForIcon
Review Request #107039 - Created Oct. 25, 2012 and submitted
Use QPixmapCache for KStandardItemListWidget::pixmapForIcon(const QString& name, int size) -> Avoid KIcon loading and rescaleing
According to valgrind/callgrind lesser cpu time and according to valgrind/massif lesser memory consume
|Just to be sure that we don't get accidental key collisons between "icon1" with size 25 and "icon12" with size ...||Frank Reininghaus|
Thanks Emmanuel, very nice work! It's great that you find so many places where optimizations are possible :-) Feel free to push to master after considering the note below (I know that key collisions are unlikely, but if we can be *sure* that they won't happen, why not do it).
Just to be sure that we don't get accidental key collisons between "icon1" with size 25 and "icon12" with size 5, or even collisions with other possible future uses of QPixmapCache in Dolphin, I'd suggest that we use a key which is more or less guaranteed to be unique, something like "KStandardItemListWidget:" % name % ":" % QString::number(size). Just like in Qt's example in http://doc.qt.digia.com/qq/qq12-qpixmapcache.html