aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-06-18 22:35:13 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-06-19 07:16:19 +0200
commitb9b88962fe2f3ec23c06143129e6753ef3fd675a (patch)
tree46267d31ab5c7c9ece81e86f52c40923826246db
parent5c6762c53d47b3bd3b604afd389669a3670b1ec5 (diff)
Eradicate remaining Q_FOREACH and mark the module free of them
Q_FOREACH is scheduled for deprecation, or at the very least banned from use in Qt code. Change-Id: Iaf9e8d8be7e43231f31a86eec575605366db4e03 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--.qmake.conf2
-rw-r--r--src/imports/winextras/winextras.pro2
-rw-r--r--src/winextras/winextras.pro2
-rw-r--r--tests/manual/jumplist/main.cpp6
4 files changed, 6 insertions, 6 deletions
diff --git a/.qmake.conf b/.qmake.conf
index db2e0b6..76e7ef0 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,3 +1,5 @@
load(qt_build_config)
+DEFINES += QT_NO_FOREACH
+
MODULE_VERSION = 5.14.0
diff --git a/src/imports/winextras/winextras.pro b/src/imports/winextras/winextras.pro
index 35427ba..dc778e6 100644
--- a/src/imports/winextras/winextras.pro
+++ b/src/imports/winextras/winextras.pro
@@ -5,8 +5,6 @@ IMPORT_VERSION = 1.$$QT_MINOR_VERSION
QT += qml quick winextras winextras-private
-DEFINES += QT_NO_FOREACH
-
QML_FILES += \
JumpListLink.qml \
JumpListDestination.qml \
diff --git a/src/winextras/winextras.pro b/src/winextras/winextras.pro
index 705c48c..8f582a5 100644
--- a/src/winextras/winextras.pro
+++ b/src/winextras/winextras.pro
@@ -2,8 +2,6 @@ TARGET = QtWinExtras
QT += gui-private core-private
-DEFINES += QT_NO_FOREACH
-
SOURCES += \
qwinfunctions.cpp \
qwintaskbarbutton.cpp \
diff --git a/tests/manual/jumplist/main.cpp b/tests/manual/jumplist/main.cpp
index 0597fe5..5447187 100644
--- a/tests/manual/jumplist/main.cpp
+++ b/tests/manual/jumplist/main.cpp
@@ -51,8 +51,10 @@ static bool associateFileType()
regApplications.beginGroup("SupportedTypes");
QMimeDatabase mimeDatabase;
- foreach (const QString &t, TestWidget::supportedMimeTypes()) {
- foreach (const QString &s, mimeDatabase.mimeTypeForName(t).suffixes())
+ const auto types = TestWidget::supportedMimeTypes();
+ for (const QString &t : types) {
+ const auto suffixes = mimeDatabase.mimeTypeForName(t).suffixes();
+ for (const QString &s : suffixes)
regApplications.setValue('.' + s, QString());
}
regApplications.endGroup();