From kde-commits Sat May 29 02:54:45 2010 From: Michael Pyne Date: Sat, 29 May 2010 02:54:45 +0000 To: kde-commits Subject: KDE/kdelibs/kdeui/icons Message-Id: <20100529025445.11498AC8C2 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=127510132710810 SVN commit 1131792 by mpyne: Do not allow duplicate paths in the icon search path for KIconTheme. This change reduces the search path on my system using the default theme from 105 to 76 entries. A completely unscientific test opening Dolphin on /usr/bin with previews enabled and closing as soon as the view was drawn showed only a minor improvement (about 14.6 seconds to 13.2 seconds). However I've also seen "regressions" in performance because my test is also highly affected by kernel caching, KSharedDataCache performance, etc so your mileage may vary. M +4 -1 kicontheme.cpp --- trunk/KDE/kdelibs/kdeui/icons/kicontheme.cpp #1131791:1131792 @@ -133,6 +133,7 @@ QStringList::ConstIterator it, itDir; QStringList themeDirs; QString cDir; + QMap addedDirs; // Used for avoiding duplicates. // Applications can have local additions to the global "locolor" and // "hicolor" icon themes. For these, the _global_ theme description @@ -204,7 +205,9 @@ for (it=dirs.begin(); it!=dirs.end(); ++it) { KConfigGroup cg(d->sharedConfig, *it); for (itDir=themeDirs.constBegin(); itDir!=themeDirs.constEnd(); ++itDir) { - if (KStandardDirs::exists(*itDir + *it + '/')) { + const QString currentDir(*itDir + *it + '/'); + if (KStandardDirs::exists(currentDir) && !addedDirs.contains(currentDir)) { + addedDirs.insert(currentDir, true); KIconThemeDir *dir = new KIconThemeDir(*itDir, *it, cg); if (!dir->isValid()) { delete dir;