summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-04-27 19:16:56 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-06-27 14:35:31 +0200
commitc0abbd39fcb4a67fdef6b82ba1b2bcafe023f073 (patch)
tree4956d46a1f0d1aecb233038d25e01aa21f07ab2f /qmake
parenta2382f7f15ad25169db24cfd090e68d5bcb11e08 (diff)
reduce a bit of code dupe while assembling feature search path
instead of having a bunch of nested loops, collect into a temporary list and process it at the end. Change-Id: I97e5642f7e13f7c7b69eae00833e61cdf46a02ed Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/project.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp
index c2558cccf6..69abfac626 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -580,15 +580,13 @@ QStringList QMakeProject::qmakeFeaturePaths()
feature_roots += cached_qmakefeatures;
if(prop)
feature_roots += splitPathList(prop->value("QMAKEFEATURES"));
+ QStringList feature_bases;
if (!cached_build_root.isEmpty())
- for(QStringList::Iterator concat_it = concat.begin();
- concat_it != concat.end(); ++concat_it)
- feature_roots << (cached_build_root + (*concat_it));
+ feature_bases << cached_build_root;
QStringList qmakepath = splitPathList(QString::fromLocal8Bit(qgetenv("QMAKEPATH")));
qmakepath += cached_qmakepath;
foreach (const QString &path, qmakepath)
- foreach (const QString &cat, concat)
- feature_roots << (path + mkspecs_concat + cat);
+ feature_bases << (path + mkspecs_concat);
if (!real_spec.isEmpty()) {
// The spec is already platform-dependent, so no subdirs here.
feature_roots << real_spec + base_concat;
@@ -600,19 +598,17 @@ QStringList QMakeProject::qmakeFeaturePaths()
const QString specrootpath = specrootdir.path();
if (specrootpath.endsWith(mkspecs_concat)) {
if (QFile::exists(specrootpath + base_concat))
- for (QStringList::Iterator concat_it = concat.begin();
- concat_it != concat.end(); ++concat_it)
- feature_roots << (specrootpath + (*concat_it));
+ feature_bases << specrootpath;
break;
}
specrootdir.cdUp();
}
}
- for(QStringList::Iterator concat_it = concat.begin();
- concat_it != concat.end(); ++concat_it)
- feature_roots << (QLibraryInfo::rawLocation(QLibraryInfo::HostDataPath,
- QLibraryInfo::EffectivePaths) +
- mkspecs_concat + (*concat_it));
+ feature_bases << (QLibraryInfo::rawLocation(QLibraryInfo::HostDataPath,
+ QLibraryInfo::EffectivePaths) + mkspecs_concat);
+ foreach (const QString &fb, feature_bases)
+ foreach (const QString &cc, concat)
+ feature_roots << (fb + cc);
feature_roots.removeDuplicates();
QStringList ret;