diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-12-22 18:17:19 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-07-05 06:09:56 +0000 |
commit | f8df5799b68fcb8690462b6dce226e6ce9bac282 (patch) | |
tree | c88fbdc8b4bd28662cfe3c14d665c4744fc29057 /src/plugins/geoservices/osm/qplacesearchreplyosm.cpp | |
parent | 5ccc595db4e9282f6a58f8712550eda935a6eecb (diff) | |
download | qtlocation-f8df5799b68fcb8690462b6dce226e6ce9bac282.tar.gz |
Enable incremental updates in PlaceSearchModel
This way pages can be changed without resetting the model.
To achieve this, new members into QPlaceSearchRequestPrivate
are introduced, to keep the relationship between a request
for one page, and the previous or the next page.
In this way sparse population of the model becomes possible.
Change-Id: Ic8db0281408f3500ba83f78c7e152ee0b68cd099
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/plugins/geoservices/osm/qplacesearchreplyosm.cpp')
-rw-r--r-- | src/plugins/geoservices/osm/qplacesearchreplyosm.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/geoservices/osm/qplacesearchreplyosm.cpp b/src/plugins/geoservices/osm/qplacesearchreplyosm.cpp index 0228a975..80c50d1b 100644 --- a/src/plugins/geoservices/osm/qplacesearchreplyosm.cpp +++ b/src/plugins/geoservices/osm/qplacesearchreplyosm.cpp @@ -48,6 +48,7 @@ #include <QtPositioning/QGeoRectangle> #include <QtLocation/QPlaceResult> #include <QtLocation/QPlaceSearchRequest> +#include <QtLocation/private/qplacesearchrequest_p.h> QT_BEGIN_NAMESPACE @@ -135,6 +136,9 @@ void QPlaceSearchReplyOsm::replyFinished() parameters.insert(QStringLiteral("ExcludePlaceIds"), epi); r.setSearchContext(parameters); + QPlaceSearchRequestPrivate *rpimpl = QPlaceSearchRequestPrivate::get(r); + rpimpl->related = true; + rpimpl->page--; setPreviousPageRequest(r); } @@ -147,6 +151,9 @@ void QPlaceSearchReplyOsm::replyFinished() parameters.insert(QStringLiteral("ExcludePlaceIds"), epi); r.setSearchContext(parameters); + QPlaceSearchRequestPrivate *rpimpl = QPlaceSearchRequestPrivate::get(r); + rpimpl->related = true; + rpimpl->page++; setNextPageRequest(r); } |