diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-12-21 13:12:20 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-01-10 12:30:07 +0000 |
commit | 812c2286d603bc5eaf56c5f9b25641b2c51e1183 (patch) | |
tree | a7bf7ba20ccbafed353fd445e8ea1e83f2f6d10e /tests | |
parent | b286e8e2fd800cb0ff0b08828e987961d07ab25b (diff) |
windeployqt: Compile with QT_NO_FOREACH
Remove usage of foreach, replace by C++ 11 range based for.
On this occasion, change all loops over QDir::entryList() to use
QDir::entryInfoList() which is more efficient and makes path
construction easier.
Change-Id: I18b83fccdf497ca6b0466cacde876c795299b566
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/windeployqt/tst_windeployqt.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/windeployqt/tst_windeployqt.cpp b/tests/auto/windeployqt/tst_windeployqt.cpp index b9d30a50b..c369bdb09 100644 --- a/tests/auto/windeployqt/tst_windeployqt.cpp +++ b/tests/auto/windeployqt/tst_windeployqt.cpp @@ -167,7 +167,8 @@ void tst_windeployqt::deploy() const QChar pathSeparator(QLatin1Char(';')); // ### fixme: Qt 5.6: QDir::listSeparator() const QString origPath = env.value(pathKey); QString newPath; - foreach (const QString &pathElement, origPath.split(pathSeparator, QString::SkipEmptyParts)) { + const QStringList pathElements = origPath.split(pathSeparator, QString::SkipEmptyParts); + for (const QString &pathElement : pathElements) { if (pathElement.compare(qtBinDir, Qt::CaseInsensitive) && !pathElement.contains(QLatin1String("\\lib"), Qt::CaseInsensitive)) { if (!newPath.isEmpty()) |