summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/osm/qplacesearchreplyosm.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-12-22 18:17:19 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-07-05 06:09:56 +0000
commitf8df5799b68fcb8690462b6dce226e6ce9bac282 (patch)
treec88fbdc8b4bd28662cfe3c14d665c4744fc29057 /src/plugins/geoservices/osm/qplacesearchreplyosm.cpp
parent5ccc595db4e9282f6a58f8712550eda935a6eecb (diff)
downloadqtlocation-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.cpp7
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);
}