diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-04-12 13:01:38 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-04-20 06:10:03 +0000 |
commit | 40b9692ba98b93da50e7a3d35c178c41853c3d0a (patch) | |
tree | 34529b5e15514b81455bb810f56bb76134647ebe /src/plugins/geoservices | |
parent | 02357b4e73f48566cda168f58025cf13a26ade5b (diff) | |
download | qtlocation-40b9692ba98b93da50e7a3d35c178c41853c3d0a.tar.gz |
QPlaceManagerEngineMapbox: No longer use deprecated qSort()
Replace by std::sort(), fixing:
qplacesearchreplymapbox.cpp:213:10: warning: 'void qSort(RandomAccessIterator, RandomAccessIterator, LessThan) [with RandomAccessIterator = QList<QPlaceSearchResult>::iterator; LessThan = QPlaceSearchReplyMapbox::onReplyFinished()::<lambda(const QPlaceResult&, const QPlaceResult&)>]' is deprecated: Use std::sort [-Wdeprecated-declarations]
Amends 13189f0741c755bfbde889e91c67c168faa3709f.
Change-Id: Ib5bab5a924e559f810754f44ebdd849915d70c43
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src/plugins/geoservices')
-rw-r--r-- | src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp b/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp index a6654e81..a79af1cb 100644 --- a/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp +++ b/src/plugins/geoservices/mapbox/qplacesearchreplymapbox.cpp @@ -51,6 +51,8 @@ #include <QtLocation/QPlaceSearchRequest> #include <QtLocation/QPlaceContactDetail> +#include <algorithm> + QT_BEGIN_NAMESPACE namespace { @@ -204,11 +206,11 @@ void QPlaceSearchReplyMapbox::onReplyFinished() } if (request().relevanceHint() == QPlaceSearchRequest::DistanceHint) { - qSort(results.begin(), results.end(), [](const QPlaceResult &a, const QPlaceResult &b) -> bool { + std::sort(results.begin(), results.end(), [](const QPlaceResult &a, const QPlaceResult &b) -> bool { return a.distance() < b.distance(); }); } else if (request().relevanceHint() == QPlaceSearchRequest::LexicalPlaceNameHint) { - qSort(results.begin(), results.end(), [](const QPlaceResult &a, const QPlaceResult &b) -> bool { + std::sort(results.begin(), results.end(), [](const QPlaceResult &a, const QPlaceResult &b) -> bool { return a.place().name() < b.place().name(); }); } |