summaryrefslogtreecommitdiffstats
path: root/qmake/generators/makefile.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-01-26 14:38:54 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-01-28 20:25:11 +0000
commit3f3140d38a75b8fdef8742d5fe9345cc3fe359cc (patch)
treea04eab25759c6340cdda99b13ab0cf89f6fd6eba /qmake/generators/makefile.cpp
parentc9cb20c01a0f3fa93ff9f79fd7ea3f53939497c4 (diff)
qmake: eradicate Q_FOREACH loops [const-& returns]
... by replacing them with C++11 range-for loops. The functions QMakeProject::values(), QMakeMetaInfo::values() and QHashIterator::value() all return by const-reference, so they can be passed to range-for without further changes. Change-Id: Ic3b39ed8ff8cd7a6f287f1aa9d61a1acd67d7aaa Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r--qmake/generators/makefile.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 4396ad05e3..4a396d3a44 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -904,7 +904,7 @@ MakefileGenerator::processPrlFile(QString &file)
project->values("QMAKE_CURRENT_PRL_LIBS") = libinfo.values("QMAKE_PRL_LIBS");
ProStringList &defs = project->values("DEFINES");
const ProStringList &prl_defs = project->values("PRL_EXPORT_DEFINES");
- foreach (const ProString &def, libinfo.values("QMAKE_PRL_DEFINES"))
+ for (const ProString &def : libinfo.values("QMAKE_PRL_DEFINES"))
if (!defs.contains(def) && prl_defs.contains(def))
defs.append(def);
if (try_replace_file) {
@@ -1141,7 +1141,7 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src)
<< " " << escapeDependencyPaths(findDependencies(srcf)).join(" \\\n\t\t");
ProKey comp;
- foreach (const ProString &compiler, project->values("QMAKE_BUILTIN_COMPILERS")) {
+ for (const ProString &compiler : project->values("QMAKE_BUILTIN_COMPILERS")) {
// Unfortunately we were not consistent about the C++ naming
ProString extensionSuffix = compiler;
if (extensionSuffix == "CXX")
@@ -1152,7 +1152,7 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src)
if (compilerSuffix == "C")
compilerSuffix = ProString("CC");
- foreach (const ProString &extension, project->values(ProKey("QMAKE_EXT_" + extensionSuffix))) {
+ for (const ProString &extension : project->values(ProKey("QMAKE_EXT_" + extensionSuffix))) {
if ((*sit).endsWith(extension)) {
comp = ProKey("QMAKE_RUN_" + compilerSuffix);
break;
@@ -1450,7 +1450,7 @@ QString
MakefileGenerator::fixFileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const
{
ProStringList varList;
- foreach (const ProString &val, project->values(var))
+ for (const ProString &val : project->values(var))
varList << escapeFilePath(Option::fixPathToTargetOS(val.toQString()));
return valGlue(varList, before, glue, after);
}
@@ -2769,11 +2769,11 @@ MakefileGenerator::parseLibFlag(const ProString &flag, ProString *arg)
ProStringList
MakefileGenerator::fixLibFlags(const ProKey &var)
{
- ProStringList in = project->values(var);
+ const ProStringList &in = project->values(var);
ProStringList ret;
ret.reserve(in.length());
- foreach (const ProString &v, in)
+ for (const ProString &v : in)
ret << fixLibFlag(v);
return ret;
}