summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32
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/win32
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/win32')
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp12
-rw-r--r--qmake/generators/win32/winmakefile.cpp2
2 files changed, 7 insertions, 7 deletions
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 6eb106a5a9..3715a8cce4 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -409,7 +409,7 @@ bool VcprojGenerator::isStandardSuffix(const QString &suffix) const
ProString VcprojGenerator::firstInputFileName(const ProString &extraCompilerName) const
{
- foreach (const ProString &var, project->values(ProKey(extraCompilerName + ".input"))) {
+ for (const ProString &var : project->values(ProKey(extraCompilerName + ".input"))) {
const ProStringList &files = project->values(var.toKey());
if (!files.isEmpty())
return files.first();
@@ -688,7 +688,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
QHashIterator<VcsolutionDepend *, QStringList> extraIt(extraSubdirs);
while (extraIt.hasNext()) {
extraIt.next();
- foreach (const QString &depend, extraIt.value()) {
+ for (const QString &depend : extraIt.value()) {
if (!projGuids[depend].isEmpty()) {
extraIt.key()->dependencies << projGuids[depend];
} else if (!profileLookup[depend].isEmpty()) {
@@ -867,7 +867,7 @@ void VcprojGenerator::init()
// Add all input files for a custom compiler into a map for uniqueness,
// unless the compiler is configure as a combined stage, then use the first one
- foreach (const ProString &quc, project->values("QMAKE_EXTRA_COMPILERS")) {
+ for (const ProString &quc : project->values("QMAKE_EXTRA_COMPILERS")) {
const ProStringList &invar = project->values(ProKey(quc + ".input"));
const QString compiler_out = project->first(ProKey(quc + ".output")).toQString();
for (ProStringList::ConstIterator iit = invar.constBegin(); iit != invar.constEnd(); ++iit) {
@@ -1189,7 +1189,7 @@ void VcprojGenerator::initResourceTool()
else
conf.resource.PreprocessorDefinitions = conf.compiler.PreprocessorDefinitions;
- foreach (const ProString &path, project->values("RC_INCLUDEPATH")) {
+ for (const ProString &path : project->values("RC_INCLUDEPATH")) {
QString fixedPath = fileFixify(path.toQString());
if (fileInfo(fixedPath).isRelative()) {
if (fixedPath == QLatin1String("."))
@@ -1344,7 +1344,7 @@ void VcprojGenerator::initDeploymentTool()
}
}
- foreach (const ProString &item, project->values("INSTALLS")) {
+ for (const ProString &item : project->values("INSTALLS")) {
// get item.path
QString devicePath = project->first(ProKey(item + ".path")).toQString();
if (!conf.WinRT) {
@@ -1359,7 +1359,7 @@ void VcprojGenerator::initDeploymentTool()
}
}
// foreach d in item.files
- foreach (const ProString &src, project->values(ProKey(item + ".files"))) {
+ for (const ProString &src : project->values(ProKey(item + ".files"))) {
QString itemDevicePath = devicePath;
QString source = Option::normalizePath(src.toQString());
QString nameFilter;
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 5eb5360ff3..475aa6d919 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -263,7 +263,7 @@ void Win32MakefileGenerator::processRcFileVar()
QString versionString = vers.join('.');
QStringList rcIcons;
- foreach (const ProString &icon, project->values("RC_ICONS"))
+ for (const ProString &icon : project->values("RC_ICONS"))
rcIcons.append(fileFixify(icon.toQString(), FileFixifyAbsolute));
QString companyName;