From ea5de1552a8eec8ab61d7829e1bbcc01821affd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Tue, 23 Oct 2018 22:05:27 -0300 Subject: [PATCH] Terrain: Change from foreach to c++11 for MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/Terrain/TerrainQuery.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Terrain/TerrainQuery.cc b/src/Terrain/TerrainQuery.cc index 77074762e..b2d1dada9 100644 --- a/src/Terrain/TerrainQuery.cc +++ b/src/Terrain/TerrainQuery.cc @@ -46,7 +46,7 @@ void TerrainAirMapQuery::requestCoordinateHeights(const QList& c } QString points; - foreach (const QGeoCoordinate& coord, coordinates) { + for (const QGeoCoordinate& coord: coordinates) { points += QString::number(coord.latitude(), 'f', 10) + "," + QString::number(coord.longitude(), 'f', 10) + ","; } @@ -236,7 +236,7 @@ void TerrainAirMapQuery::_parsePathData(const QJsonValue& pathJson) double lonStep = stepArray[1].toDouble(); QList heights; - foreach (const QJsonValue& profileValue, profileArray) { + for (const QJsonValue& profileValue: profileArray) { heights.append(profileValue.toDouble()); } @@ -404,7 +404,7 @@ bool TerrainTileManager::_getAltitudesForCoordinates(const QList { error = false; - foreach (const QGeoCoordinate& coordinate, coordinates) { + for (const QGeoCoordinate& coordinate: coordinates) { QString tileHash = _getTileHash(coordinate); qCDebug(TerrainQueryLog) << "TerrainTileManager::_getAltitudesForCoordinates hash:coordinate" << tileHash << coordinate; @@ -451,7 +451,7 @@ void TerrainTileManager::_tileFailed(void) { QList noAltitudes; - foreach (const QueuedRequestInfo_t& requestInfo, _requestQueue) { + for (const QueuedRequestInfo_t& requestInfo: _requestQueue) { if (requestInfo.queryMode == QueryMode::QueryModeCoordinates) { requestInfo.terrainQueryInterface->_signalCoordinateHeights(false, noAltitudes); } else if (requestInfo.queryMode == QueryMode::QueryModePath) { @@ -584,7 +584,7 @@ void TerrainAtCoordinateBatchManager::_sendNextBatch(void) // Convert coordinates to point strings for json query QList coords; int requestQueueAdded = 0; - foreach (const QueuedRequestInfo_t& requestInfo, _requestQueue) { + for (const QueuedRequestInfo_t& requestInfo: _requestQueue) { SentRequestInfo_t sentRequestInfo = { requestInfo.terrainAtCoordinateQuery, false, requestInfo.coordinates.count() }; _sentRequests.append(sentRequestInfo); coords += requestInfo.coordinates; @@ -604,7 +604,7 @@ void TerrainAtCoordinateBatchManager::_batchFailed(void) { QList noHeights; - foreach (const SentRequestInfo_t& sentRequestInfo, _sentRequests) { + for (const SentRequestInfo_t& sentRequestInfo: _sentRequests) { if (!sentRequestInfo.queryObjectDestroyed) { disconnect(sentRequestInfo.terrainAtCoordinateQuery, &TerrainAtCoordinateQuery::destroyed, this, &TerrainAtCoordinateBatchManager::_queryObjectDestroyed); sentRequestInfo.terrainAtCoordinateQuery->_signalTerrainData(false, noHeights); @@ -663,7 +663,7 @@ void TerrainAtCoordinateBatchManager::_coordinateHeights(bool success, QList path; - foreach (const QVariant& geoVar, polyPath) { + for (const QVariant& geoVar: polyPath) { path.append(geoVar.value()); } -- 2.22.0