From 1d0966c6924876655c52725e779a7aa24866ff60 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Thu, 16 Jan 2014 14:32:21 +1000 Subject: 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 --- .../location/places/content/places/SearchResultView.qml | 2 ++ examples/location/places/places.qml | 17 ----------------- 2 files changed, 2 insertions(+), 17 deletions(-) (limited to 'examples') 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(); } -- cgit v1.2.1