diff options
author | Robert Griebl <robert.griebl@qt.io> | 2022-02-08 16:42:18 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2022-02-10 09:17:38 +0000 |
commit | b9f9bf99b034123d30f9306b7d1a3bf1c503281c (patch) | |
tree | 9733cd0d0c62336a6483460720058d92f9a6b744 | |
parent | 5297a1b22752fe0978e81a1da0146f1d2d150158 (diff) | |
download | qtapplicationmanager-b9f9bf99b034123d30f9306b7d1a3bf1c503281c.tar.gz |
Prefer STL style iterators over the Java variety
Change-Id: Ia633cdaa9ac870f538dd4bcec230e76ca57fb170
Fixes: QTBUG-100510
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
(cherry picked from commit 30482d24678748e457bec0f466eab649933e1dde)
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
-rw-r--r-- | src/intent-server-lib/intent.cpp | 4 | ||||
-rw-r--r-- | src/manager-lib/nativeruntime.cpp | 7 | ||||
-rw-r--r-- | src/manager-lib/qmlinprocessapplicationmanagerwindow.cpp | 7 |
3 files changed, 7 insertions, 11 deletions
diff --git a/src/intent-server-lib/intent.cpp b/src/intent-server-lib/intent.cpp index 9ed8f7f1..651176d6 100644 --- a/src/intent-server-lib/intent.cpp +++ b/src/intent-server-lib/intent.cpp @@ -166,9 +166,7 @@ QString Intent::applicationId() const bool Intent::checkParameterMatch(const QVariantMap ¶meters) const { - QMapIterator<QString, QVariant> rit(m_parameterMatch); - while (rit.hasNext()) { - rit.next(); + for (auto rit = m_parameterMatch.cbegin(); rit != m_parameterMatch.cend(); ++rit) { const QString ¶mName = rit.key(); auto pit = parameters.find(paramName); if (pit == parameters.cend()) diff --git a/src/manager-lib/nativeruntime.cpp b/src/manager-lib/nativeruntime.cpp index 5c399048..31d842a2 100644 --- a/src/manager-lib/nativeruntime.cpp +++ b/src/manager-lib/nativeruntime.cpp @@ -307,8 +307,8 @@ bool NativeRuntime::start() env.insert(qSL("AM_NO_DLT_LOGGING"), qSL("1")); } - for (QMapIterator<QString, QVariant> it(configuration().value(qSL("environmentVariables")).toMap()); it.hasNext(); ) { - it.next(); + const auto envVars = configuration().value(qSL("environmentVariables")).toMap(); + for (auto it = envVars.cbegin(); it != envVars.cend(); ++it) { if (!it.key().isEmpty()) env.insert(it.key(), it.value().toString()); } @@ -321,8 +321,7 @@ bool NativeRuntime::start() qCWarning(LogSystem) << "Due to enabled security checks, the environmentVariables for" << m_app->id() << "(given in info.yaml) will be ignored"; } else { - for (QMapIterator<QString, QVariant> it(envVars); it.hasNext(); ) { - it.next(); + for (auto it = envVars.cbegin(); it != envVars.cend(); ++it) { if (!it.key().isEmpty()) env.insert(it.key(), it.value().toString()); } diff --git a/src/manager-lib/qmlinprocessapplicationmanagerwindow.cpp b/src/manager-lib/qmlinprocessapplicationmanagerwindow.cpp index 33232cad..06bf4e76 100644 --- a/src/manager-lib/qmlinprocessapplicationmanagerwindow.cpp +++ b/src/manager-lib/qmlinprocessapplicationmanagerwindow.cpp @@ -205,11 +205,10 @@ void QmlInProcessApplicationManagerWindow::componentComplete() m_attachedCompleteHandlers.removeAll(a); if (m_attachedCompleteHandlers.isEmpty()) { - QMutableVectorIterator<QmlInProcessApplicationManagerWindow *> iter(s_inCompleteWindows); - while (iter.hasNext()) { - QmlInProcessApplicationManagerWindow *win = iter.next(); + for (auto it = s_inCompleteWindows.cbegin(); it != s_inCompleteWindows.cend(); ) { + QmlInProcessApplicationManagerWindow *win = *it; if (win->m_attachedCompleteHandlers.isEmpty()) { - iter.remove(); + it = s_inCompleteWindows.erase(it); win->notifyRuntimeAboutSurface(); } else { break; |