From 812c2286d603bc5eaf56c5f9b25641b2c51e1183 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 21 Dec 2016 13:12:20 +0100 Subject: 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 Reviewed-by: Maurice Kalinowski Reviewed-by: Friedemann Kleint --- tests/auto/windeployqt/tst_windeployqt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') 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()) -- cgit v1.2.3