diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-07-24 12:39:01 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-07-26 08:34:51 +0000 |
commit | da870b829cc860ca394af836733dbcc002016061 (patch) | |
tree | f9e1dc0774f43b2f621eac7654ec139ab00ba285 /src/plugins/geoservices/osm/qplacemanagerengineosm.cpp | |
parent | 7c00aa7aa1476fc45adc5abf54185545ecc4c14e (diff) | |
download | qtlocation-da870b829cc860ca394af836733dbcc002016061.tar.gz |
Replace foreach with ranged for and set QT_NO_FOREACH
Make containers const where they obviously should be, iterate over
references where it's clearly possible.
Cherry-pick of 2c8c5dca44aba5612cc67b04dd3c7e5fc4919b19.
Change-Id: Ie55a58873b48bbb60ac49790db612f85777e6ceb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/geoservices/osm/qplacemanagerengineosm.cpp')
-rw-r--r-- | src/plugins/geoservices/osm/qplacemanagerengineosm.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/geoservices/osm/qplacemanagerengineosm.cpp b/src/plugins/geoservices/osm/qplacemanagerengineosm.cpp index c0d467f4..8c29652c 100644 --- a/src/plugins/geoservices/osm/qplacemanagerengineosm.cpp +++ b/src/plugins/geoservices/osm/qplacemanagerengineosm.cpp @@ -158,7 +158,7 @@ QPlaceSearchReply *QPlaceManagerEngineOsm::search(const QPlaceSearchRequest &req if (!request.searchTerm().isEmpty()) queryParts.append(request.searchTerm()); - foreach (const QPlaceCategory &category, request.categories()) { + for (const QPlaceCategory &category : request.categories()) { QString id = category.categoryId(); int index = id.indexOf(QLatin1Char('=')); if (index != -1) @@ -239,7 +239,7 @@ QPlaceCategory QPlaceManagerEngineOsm::category(const QString &categoryId) const QList<QPlaceCategory> QPlaceManagerEngineOsm::childCategories(const QString &parentId) const { QList<QPlaceCategory> categories; - foreach (const QString &id, m_subcategories.value(parentId)) + for (const QString &id : m_subcategories.value(parentId)) categories.append(m_categories.value(id)); return categories; } @@ -315,14 +315,14 @@ void QPlaceManagerEngineOsm::categoryReplyFinished() m_categoryLocales.clear(); } - foreach (QPlaceCategoriesReplyOsm *reply, m_pendingCategoriesReply) + for (QPlaceCategoriesReplyOsm *reply : m_pendingCategoriesReply) reply->emitFinished(); m_pendingCategoriesReply.clear(); } void QPlaceManagerEngineOsm::categoryReplyError() { - foreach (QPlaceCategoriesReplyOsm *reply, m_pendingCategoriesReply) + for (QPlaceCategoriesReplyOsm *reply : m_pendingCategoriesReply) reply->setError(QPlaceReply::CommunicationError, tr("Network request error")); } |