diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-12-22 10:04:27 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-12-22 11:29:29 +0000 |
commit | 8c3946e5f957f5dc5cd1f2e549edd8999f63eeb6 (patch) | |
tree | e328171b5b88015ab60c04db8f6e9bcb90d148f9 /src/qtdiag | |
parent | 3269e2aa561db8fa14f09d4545b5feefa3602ad5 (diff) |
foreach cleanup in the the smaller tools
Replace foreach by C++ 11 range based for in
kmap2qmap, makeqpf, pixeltool, qdbus, qtattributionsscanner,
qtdiag, qtplugininfo, winrtrunner and the simpletextviewer example.
Change-Id: I079da84c47a1584526f4fe188377c0262419a44d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/qtdiag')
-rw-r--r-- | src/qtdiag/qtdiag.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qtdiag/qtdiag.cpp b/src/qtdiag/qtdiag.cpp index d12dd691e..dcf7f8faa 100644 --- a/src/qtdiag/qtdiag.cpp +++ b/src/qtdiag/qtdiag.cpp @@ -174,7 +174,7 @@ void dumpGlInfo(QTextStream &str, bool listExtensions) QList<QByteArray> extensionList = context.extensions().toList(); std::sort(extensionList.begin(), extensionList.end()); str << " \nFound " << extensionList.size() << " extensions:\n"; - foreach (const QByteArray &extension, extensionList) + for (const QByteArray &extension : qAsConst(extensionList)) str << " " << extension << '\n'; } } else { @@ -347,7 +347,8 @@ QString qtDiag(unsigned flags) #ifndef QT_NO_PROCESS const QProcessEnvironment systemEnvironment = QProcessEnvironment::systemEnvironment(); str << "\nEnvironment:\n"; - foreach (const QString &key, systemEnvironment.keys()) { + const QStringList keys = systemEnvironment.keys(); + for (const QString &key : keys) { if (key.startsWith(QLatin1Char('Q'))) str << " " << key << "=\"" << systemEnvironment.value(key) << "\"\n"; } @@ -396,7 +397,8 @@ QString qtDiag(unsigned flags) DUMP_STANDARDPATH(str, AppConfigLocation) str << "\nFile selectors (increasing order of precedence):\n "; - foreach (const QString &s, QFileSelector().allSelectors()) + const QStringList allSelectors = QFileSelector().allSelectors(); + for (const QString &s : allSelectors) str << ' ' << s; str << "\n\nNetwork:\n "; @@ -553,7 +555,7 @@ QString qtDiag(unsigned flags) const QList<const QTouchDevice *> touchDevices = QTouchDevice::devices(); if (!touchDevices.isEmpty()) { str << "Touch devices: " << touchDevices.size() << '\n'; - foreach (const QTouchDevice *device, touchDevices) { + for (const QTouchDevice *device : touchDevices) { str << " " << (device->type() == QTouchDevice::TouchScreen ? "TouchScreen" : "TouchPad") << " \"" << device->name() << "\", max " << device->maximumTouchPoints() << " touch points, capabilities:"; |