[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdeui/icons
From:       Peter Penz <peter.penz () gmx ! at>
Date:       2010-05-29 10:39:12
Message-ID: 20100529103912.CA46AAC8C2 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1132015 by ppenz:

Fix performance bottleneck in KIconEngine::actualSize(). The method is called several \
thousands of times when e. g. loading the directory /usr/bin with Dolphin/Konqueror \
because of the way the layout mechanism works in QListView/QItemDelegate. See \
http://reviewboard.kde.org/r/4052 for more details. The patch has been implemented by \
David Faure.

 M  +3 -5      kiconengine.cpp  


--- trunk/KDE/kdelibs/kdeui/icons/kiconengine.cpp #1132014:1132015
@@ -60,11 +60,9 @@
 QSize KIconEngine::actualSize( const QSize & size, QIcon::Mode mode, QIcon::State \
state )  {
     Q_UNUSED(state)
-    const int kstate = qIconModeToKIconState(mode);
-    const QPixmap pix = mIconLoader->loadIcon(mIconName, KIconLoader::Desktop,
-                                         qMin(size.width(), size.height()),
-                                         kstate, mOverlays);
-    return pix.size();
+    Q_UNUSED(mode)
+    const int iconSize = qMin(size.width(), size.height());
+    return QSize(iconSize, iconSize);
 }
 
 void KIconEngine::paint( QPainter * painter, const QRect & rect, QIcon::Mode mode, \
QIcon::State state )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic