summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2010-11-25 10:42:57 (GMT)
committerJoerg Bornemann <joerg.bornemann@nokia.com>2010-11-25 16:08:44 (GMT)
commit68affbdc60b6cc48b6e7786ffffe2b7512cade64 (patch)
tree403019e6273ccb9e7c3ff7bdc6f9ab67eacdde37 /qmake/generators/win32
parent4ab5e3c6e2a7188d0b1f9ce57c461bb8f6d22cc9 (diff)
downloadQt-68affbdc60b6cc48b6e7786ffffe2b7512cade64.zip
Qt-68affbdc60b6cc48b6e7786ffffe2b7512cade64.tar.gz
Qt-68affbdc60b6cc48b6e7786ffffe2b7512cade64.tar.bz2
fix performance penalty in Win32MakefileGenerator::findHighestVersion
Don't scan Qt's lib dir over and over again. Task-number: QTBUG-15595 Reviewed-by: ossi
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r--qmake/generators/win32/winmakefile.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 5f56d66..8cf970e 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -78,8 +78,14 @@ Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem
int biggest=-1;
if(!project->isActiveConfig("no_versionlink")) {
- QDir dir(bd);
- QStringList entries = dir.entryList();
+ static QHash<QString, QStringList> dirEntryListCache;
+ QStringList entries = dirEntryListCache.value(bd);
+ if (entries.isEmpty()) {
+ QDir dir(bd);
+ entries = dir.entryList();
+ dirEntryListCache.insert(bd, entries);
+ }
+
QRegExp regx(QString("((lib)?%1([0-9]*)).(%2|prl)$").arg(dllStem).arg(ext), Qt::CaseInsensitive);
for(QStringList::Iterator it = entries.begin(); it != entries.end(); ++it) {
if(regx.exactMatch((*it))) {