diff options
author | Aaron McCarthy <aaron.mccarthy@jollamobile.com> | 2014-01-16 14:32:21 +1000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-20 02:11:24 +0100 |
commit | 1d0966c6924876655c52725e779a7aa24866ff60 (patch) | |
tree | bb7220ab3ccce1d057b80af33dbb8dd784d5782e /examples | |
parent | 86db3df8cea7b9ac1e4ae078639de5fb5a43ca69 (diff) | |
download | qtlocation-1d0966c6924876655c52725e779a7aa24866ff60.tar.gz |
Remove offset attribute from place search requests.
Not all service providers support arbitrary search offsets. The offset
attribute has been removed, instead service providers can supply a
previous and next search query in the form of a QPlaceSearchRequest.
Change-Id: If68e969b06f909f3fa62718656cbef70d1bf84a6
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/location/places/content/places/SearchResultView.qml | 2 | ||||
-rw-r--r-- | examples/location/places/places.qml | 17 |
2 files changed, 2 insertions, 17 deletions
diff --git a/examples/location/places/content/places/SearchResultView.qml b/examples/location/places/content/places/SearchResultView.qml index b9d48776..da62a5c5 100644 --- a/examples/location/places/content/places/SearchResultView.qml +++ b/examples/location/places/content/places/SearchResultView.qml @@ -97,6 +97,7 @@ Item { Button { text: qsTr("Previous") + enabled: placeSearchModel.previousPagesAvailable onClicked: placeSearchModel.previousPage() anchors.left: parent.left @@ -111,6 +112,7 @@ Item { Button { text: qsTr("Next") + enabled: placeSearchModel.nextPagesAvailable onClicked: placeSearchModel.nextPage() anchors.right: parent.right diff --git a/examples/location/places/places.qml b/examples/location/places/places.qml index 6b4b32dd..4a144d55 100644 --- a/examples/location/places/places.qml +++ b/examples/location/places/places.qml @@ -366,7 +366,6 @@ Item { recommendationId = ""; searchArea = searchRegion limit = -1; - offset = 0; update(); } @@ -376,7 +375,6 @@ Item { recommendationId = ""; searchArea = searchRegion limit = -1; - offset = 0; update(); } @@ -386,21 +384,6 @@ Item { recommendationId = placeId; searchArea = null; limit = -1; - offset = 0; - update(); - } - - function previousPage() { - if (limit === -1) - limit = count; - offset = Math.max(0, offset - limit); - update(); - } - - function nextPage() { - if (limit === -1) - limit = count; - offset += limit; update(); } |