diff options
18 files changed, 188 insertions, 117 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(); } diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp b/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp index b8275da5..d773c3b9 100644 --- a/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp @@ -120,41 +120,37 @@ void QDeclarativeSearchModelBase::setSearchArea(const QVariant &searchArea) /*! \internal */ -int QDeclarativeSearchModelBase::offset() const +int QDeclarativeSearchModelBase::limit() const { - return m_request.offset(); + return m_request.limit(); } /*! \internal */ -void QDeclarativeSearchModelBase::setOffset(int offset) +void QDeclarativeSearchModelBase::setLimit(int limit) { - if (m_request.offset() == offset) + if (m_request.limit() == limit) return; - m_request.setOffset(offset); - emit offsetChanged(); + m_request.setLimit(limit); + emit limitChanged(); } /*! \internal */ -int QDeclarativeSearchModelBase::limit() const +bool QDeclarativeSearchModelBase::previousPagesAvailable() const { - return m_request.limit(); + return m_previousPageRequest != QPlaceSearchRequest(); } /*! \internal */ -void QDeclarativeSearchModelBase::setLimit(int limit) +bool QDeclarativeSearchModelBase::nextPagesAvailable() const { - if (m_request.limit() == limit) - return; - - m_request.setLimit(limit); - emit limitChanged(); + return m_nextPageRequest != QPlaceSearchRequest(); } /*! @@ -263,6 +259,30 @@ QString QDeclarativeSearchModelBase::errorString() const /*! \internal */ +void QDeclarativeSearchModelBase::previousPage() +{ + if (m_previousPageRequest == QPlaceSearchRequest()) + return; + + m_request = m_previousPageRequest; + update(); +} + +/*! + \internal +*/ +void QDeclarativeSearchModelBase::nextPage() +{ + if (m_nextPageRequest == QPlaceSearchRequest()) + return; + + m_request = m_nextPageRequest; + update(); +} + +/*! + \internal +*/ void QDeclarativeSearchModelBase::clearData(bool suppressSignal) { Q_UNUSED(suppressSignal) @@ -320,3 +340,24 @@ void QDeclarativeSearchModelBase::pluginNameChanged() { initializePlugin(m_plugin); } + +/*! + \internal +*/ +void QDeclarativeSearchModelBase::setPreviousPageRequest(const QPlaceSearchRequest &previous) +{ + if (m_previousPageRequest == previous) + return; + + m_previousPageRequest = previous; + emit previousPagesAvailableChanged(); +} + +void QDeclarativeSearchModelBase::setNextPageRequest(const QPlaceSearchRequest &next) +{ + if (m_nextPageRequest == next) + return; + + m_nextPageRequest = next; + emit nextPagesAvailableChanged(); +} diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.h b/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.h index 5b3b831c..a9516407 100644 --- a/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.h +++ b/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.h @@ -63,8 +63,9 @@ class QDeclarativeSearchModelBase : public QAbstractListModel, public QQmlParser Q_PROPERTY(QDeclarativeGeoServiceProvider *plugin READ plugin WRITE setPlugin NOTIFY pluginChanged) Q_PROPERTY(QVariant searchArea READ searchArea WRITE setSearchArea NOTIFY searchAreaChanged) - Q_PROPERTY(int offset READ offset WRITE setOffset NOTIFY offsetChanged) Q_PROPERTY(int limit READ limit WRITE setLimit NOTIFY limitChanged) + Q_PROPERTY(bool previousPagesAvailable READ previousPagesAvailable NOTIFY previousPagesAvailableChanged) + Q_PROPERTY(bool nextPagesAvailable READ nextPagesAvailable NOTIFY nextPagesAvailableChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) Q_ENUMS(Status) @@ -88,12 +89,12 @@ public: QVariant searchArea() const; void setSearchArea(const QVariant &searchArea); - int offset() const; - void setOffset(int offset); - int limit() const; void setLimit(int limit); + bool previousPagesAvailable() const; + bool nextPagesAvailable() const; + Status status() const; void setStatus(Status status, const QString &errorString = QString()); @@ -104,6 +105,9 @@ public: Q_INVOKABLE QString errorString() const; + Q_INVOKABLE void previousPage(); + Q_INVOKABLE void nextPage(); + virtual void clearData(bool suppressSignal = false); // From QQmlParserStatus @@ -113,8 +117,9 @@ public: Q_SIGNALS: void pluginChanged(); void searchAreaChanged(); - void offsetChanged(); void limitChanged(); + void previousPagesAvailableChanged(); + void nextPagesAvailableChanged(); void statusChanged(); protected: @@ -128,6 +133,8 @@ private Q_SLOTS: protected: virtual QPlaceReply *sendQuery(QPlaceManager *manager, const QPlaceSearchRequest &request) = 0; + void setPreviousPageRequest(const QPlaceSearchRequest &previous); + void setNextPageRequest(const QPlaceSearchRequest &next); QPlaceSearchRequest m_request; QDeclarativeGeoServiceProvider *m_plugin; @@ -137,6 +144,8 @@ private: bool m_complete; Status m_status; QString m_errorString; + QPlaceSearchRequest m_previousPageRequest; + QPlaceSearchRequest m_nextPageRequest; }; QT_END_NAMESPACE diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp index d9492ca2..f36f1d78 100644 --- a/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp @@ -223,19 +223,25 @@ QT_USE_NAMESPACE */ /*! - \qmlproperty int PlaceSearchModel::offset + \qmlproperty int PlaceSearchModel::limit - This property holds the index of the first search result in the model. + This property holds the limit of the number of items that will be returned. +*/ + +/*! + \qmlproperty bool PlaceSearchModel::previousPagesAvailable - \sa limit + This property holds whether there is one or more previous pages of search results available. + + \sa previousPage() */ /*! - \qmlproperty int PlaceSearchModel::limit + \qmlproperty bool PlaceSearchModel::nextPagesAvailable - This property holds the limit of the number of items that will be returned. + This property holds whether there is one or more additional pages of search results available. - \sa offset + \sa nextPage() */ /*! @@ -325,6 +331,20 @@ QT_USE_NAMESPACE textual representation. */ +/*! + \qmlmethod PlaceSearchModel::previousPage() + + Updates the model to display the previous page of search results. If there is no previous page + then this method does nothing. +*/ + +/*! + \qmlmethod PlaceSearchModel::nextPage() + + Updates the model to display the next page of search results. If there is no next page then + this method does nothing. +*/ + QDeclarativeSearchResultModel::QDeclarativeSearchResultModel(QObject *parent) : QDeclarativeSearchModelBase(parent), m_favoritesPlugin(0) { @@ -730,6 +750,9 @@ void QDeclarativeSearchResultModel::queryFinished() Q_ASSERT(searchReply); m_resultsBuffer = searchReply->results(); + setPreviousPageRequest(searchReply->previousPageRequest()); + setNextPageRequest(searchReply->nextPageRequest()); + reply->deleteLater(); if (!m_favoritesPlugin) { diff --git a/src/location/doc/snippets/places/requesthandler.h b/src/location/doc/snippets/places/requesthandler.h index 92e1a935..8771d294 100644 --- a/src/location/doc/snippets/places/requesthandler.h +++ b/src/location/doc/snippets/places/requesthandler.h @@ -100,7 +100,6 @@ public: { //! [Search paging] QPlaceSearchRequest searchRequest; - searchRequest.setOffset(10); //specify the index of the first result searchRequest.setLimit(15); //specify how many results are to be retrieved. //! [Search paging] } @@ -220,9 +219,8 @@ public: //closer places have greater weighting in the ranking of results. searchRequest.setRelevanceHint(QPlaceSearchRequest::DistanceHint); - //use offset and limit to provide pagination. - //this retrieves the next 5 items from the 10th index - searchRequest.setOffset(9); + //use limit to adjust pagination. + //this limits the number of place results to 5 per page. searchRequest.setLimit(5); //provide some categories to narrow down search diff --git a/src/location/doc/src/places.qdoc b/src/location/doc/src/places.qdoc index 62a6d0d5..74a25b79 100644 --- a/src/location/doc/src/places.qdoc +++ b/src/location/doc/src/places.qdoc @@ -248,7 +248,7 @@ Any places similar to the given place are retrieved. \section3 Paging - If the plugin supports paging, limit and offset parameters may be provided to the search request. + If the plugin supports paging, the limit parameter may be provided to the search request. \snippet places/requesthandler.h Search paging \section2 Fetching Place Details diff --git a/src/location/places/qplacesearchreply.cpp b/src/location/places/qplacesearchreply.cpp index 26829607..9d89748a 100644 --- a/src/location/places/qplacesearchreply.cpp +++ b/src/location/places/qplacesearchreply.cpp @@ -39,23 +39,23 @@ ** ****************************************************************************/ -#include "qplacesearchreply.h" -#include "qplacereply_p.h" - +#include <QtLocation/QPlaceSearchRequest> +#include <QtLocation/QPlaceSearchReply> +#include <QtLocation/QPlaceProposedSearchResult> +#include <QtLocation/private/qplacereply_p.h> QT_BEGIN_NAMESPACE + class QPlaceSearchReplyPrivate : public QPlaceReplyPrivate { public: QPlaceSearchReplyPrivate(){} QList<QPlaceSearchResult> results; QPlaceSearchRequest searchRequest; + QPlaceSearchRequest previousPageRequest; + QPlaceSearchRequest nextPageRequest; }; -QT_END_NAMESPACE - -QT_USE_NAMESPACE - /*! \class QPlaceSearchReply \inmodule QtLocation @@ -121,6 +121,30 @@ QPlaceSearchRequest QPlaceSearchReply::request() const } /*! + Returns a place search request which can be used to request the previous page of search + results. An empty place search request is returned if there is no previous page of results. + + \sa nextPageRequest(), setPreviousPageRequest() +*/ +QPlaceSearchRequest QPlaceSearchReply::previousPageRequest() const +{ + Q_D(const QPlaceSearchReply); + return d->previousPageRequest; +} + +/*! + Returns a place search request which can be used to request the next page of search results. An + empty place search request is returned if there is no next page of results. + + \sa previousPageRequest(), setNextPageRequest() +*/ +QPlaceSearchRequest QPlaceSearchReply::nextPageRequest() const +{ + Q_D(const QPlaceSearchReply); + return d->nextPageRequest; +} + +/*! Sets the search \a request used to generate this reply. */ void QPlaceSearchReply::setRequest(const QPlaceSearchRequest &request) @@ -128,3 +152,27 @@ void QPlaceSearchReply::setRequest(const QPlaceSearchRequest &request) Q_D(QPlaceSearchReply); d->searchRequest = request; } + +/*! + Sets the previous page of search results request to \a previous. + + \sa previousPageRequest() +*/ +void QPlaceSearchReply::setPreviousPageRequest(const QPlaceSearchRequest &previous) +{ + Q_D(QPlaceSearchReply); + d->previousPageRequest = previous; +} + +/*! + Sets the next page of search results request to \a next. + + \sa nextPageRequest() +*/ +void QPlaceSearchReply::setNextPageRequest(const QPlaceSearchRequest &next) +{ + Q_D(QPlaceSearchReply); + d->nextPageRequest = next; +} + +QT_END_NAMESPACE diff --git a/src/location/places/qplacesearchreply.h b/src/location/places/qplacesearchreply.h index 4266b988..51cb315f 100644 --- a/src/location/places/qplacesearchreply.h +++ b/src/location/places/qplacesearchreply.h @@ -44,11 +44,12 @@ #include <QtLocation/QPlaceReply> #include <QtLocation/QPlaceSearchResult> -#include <QtLocation/QPlaceSearchRequest> QT_BEGIN_NAMESPACE +class QPlaceSearchResult; class QPlaceSearchReplyPrivate; + class Q_LOCATION_EXPORT QPlaceSearchReply : public QPlaceReply { Q_OBJECT @@ -61,9 +62,15 @@ public: QList<QPlaceSearchResult> results() const; QPlaceSearchRequest request() const; + QPlaceSearchRequest previousPageRequest() const; + QPlaceSearchRequest nextPageRequest() const; + protected: void setResults(const QList<QPlaceSearchResult> &results); void setRequest(const QPlaceSearchRequest &request); + void setPreviousPageRequest(const QPlaceSearchRequest &previous); + void setNextPageRequest(const QPlaceSearchRequest &next); + private: Q_DISABLE_COPY(QPlaceSearchReply) Q_DECLARE_PRIVATE(QPlaceSearchReply) diff --git a/src/location/places/qplacesearchrequest.cpp b/src/location/places/qplacesearchrequest.cpp index c5878b22..81cfeba4 100644 --- a/src/location/places/qplacesearchrequest.cpp +++ b/src/location/places/qplacesearchrequest.cpp @@ -68,7 +68,6 @@ public: QLocation::VisibilityScope visibilityScope; QPlaceSearchRequest::RelevanceHint relevanceHint; int limit; - int offset; QVariant searchContext; }; @@ -76,7 +75,7 @@ QPlaceSearchRequestPrivate::QPlaceSearchRequestPrivate() : QSharedData(), visibilityScope(QLocation::UnspecifiedVisibility), relevanceHint(QPlaceSearchRequest::UnspecifiedHint), - limit(-1), offset(0) + limit(-1) { } @@ -89,7 +88,6 @@ QPlaceSearchRequestPrivate::QPlaceSearchRequestPrivate(const QPlaceSearchRequest visibilityScope(other.visibilityScope), relevanceHint(other.relevanceHint), limit(other.limit), - offset(other.offset), searchContext(other.searchContext) { } @@ -108,7 +106,6 @@ QPlaceSearchRequestPrivate &QPlaceSearchRequestPrivate::operator=(const QPlaceSe visibilityScope = other.visibilityScope; relevanceHint = other.relevanceHint; limit = other.limit; - offset = other.offset; searchContext = other.searchContext; } @@ -124,14 +121,12 @@ bool QPlaceSearchRequestPrivate::operator==(const QPlaceSearchRequestPrivate &ot visibilityScope == other.visibilityScope && relevanceHint == other.relevanceHint && limit == other.limit && - offset == other.offset && searchContext == other.searchContext; } void QPlaceSearchRequestPrivate::clear() { limit = -1; - offset = 0; searchTerm.clear(); categories.clear(); searchArea = QGeoShape(); @@ -429,27 +424,6 @@ void QPlaceSearchRequest::setLimit(int limit) } /*! - Returns the offset index of the first item that is to be retrieved. - - The default offset is 0. -*/ -int QPlaceSearchRequest::offset() const -{ - Q_D(const QPlaceSearchRequest); - return d->offset; -} - -/*! - Sets the starting index of the first item to be retrieved - to \a offset. -*/ -void QPlaceSearchRequest::setOffset(int offset) -{ - Q_D(QPlaceSearchRequest); - d->offset = offset; -} - -/*! Clears the search request. */ void QPlaceSearchRequest::clear() diff --git a/src/location/places/qplacesearchrequest.h b/src/location/places/qplacesearchrequest.h index 65ca3fe0..34a6a1dd 100644 --- a/src/location/places/qplacesearchrequest.h +++ b/src/location/places/qplacesearchrequest.h @@ -94,8 +94,6 @@ public: RelevanceHint relevanceHint() const; void setRelevanceHint(RelevanceHint hint); - int offset() const; - void setOffset(int offset); int limit() const; void setLimit(int limit); diff --git a/src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp b/src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp index 3ea8f05c..3b43c357 100644 --- a/src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp +++ b/src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp @@ -121,13 +121,10 @@ void QPlaceSearchReplyImpl::replyFinished() return; } - QJsonObject object = document.object(); + QJsonObject resultsObject = document.object(); - QJsonObject resultsObject; - if (!request().recommendationId().isEmpty()) - resultsObject = object; - else - resultsObject = object.value(QLatin1String("results")).toObject(); + if (resultsObject.contains(QStringLiteral("results"))) + resultsObject = resultsObject.value(QStringLiteral("results")).toObject(); QJsonArray items = resultsObject.value(QLatin1String("items")).toArray(); @@ -142,6 +139,18 @@ void QPlaceSearchReplyImpl::replyFinished() results.append(parseSearchResult(item)); } + if (resultsObject.contains(QStringLiteral("next"))) { + QPlaceSearchRequest request; + request.setSearchContext(QUrl(resultsObject.value(QStringLiteral("next")).toString())); + setNextPageRequest(request); + } + + if (resultsObject.contains(QStringLiteral("previous"))) { + QPlaceSearchRequest request; + request.setSearchContext(QUrl(resultsObject.value(QStringLiteral("previous")).toString())); + setPreviousPageRequest(request); + } + setResults(results); m_reply->deleteLater(); diff --git a/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp b/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp index 0d2d3953..c0b265d2 100644 --- a/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp +++ b/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp @@ -379,8 +379,6 @@ QPlaceSearchReply *QPlaceManagerEngineNokiaV2::search(const QPlaceSearchRequest unsupported |= query.visibilityScope() != QLocation::UnspecifiedVisibility && query.visibilityScope() != QLocation::PublicVisibility; - unsupported |= !query.searchTerm().isEmpty() && query.offset() > 0; - // Both a search term and search categories are not supported. unsupported |= !query.searchTerm().isEmpty() && !query.categories().isEmpty(); @@ -432,9 +430,6 @@ QPlaceSearchReply *QPlaceManagerEngineNokiaV2::search(const QPlaceSearchRequest if (query.limit() > 0) queryItems.addQueryItem(QStringLiteral("size"), QString::number(query.limit())); - if (query.offset() > -1) - queryItems.addQueryItem(QStringLiteral("offset"), QString::number(query.offset())); - u.setQuery(queryItems); networkReply = sendRequest(u); @@ -493,10 +488,6 @@ QPlaceSearchReply *QPlaceManagerEngineNokiaV2::search(const QPlaceSearchRequest queryItems.addQueryItem(QLatin1String("size"), QString::number(query.limit())); } - if (query.offset() > -1) { - queryItems.addQueryItem(QLatin1String("offset"), - QString::number(query.offset())); - } requestUrl.setQuery(queryItems); @@ -518,7 +509,6 @@ QPlaceSearchSuggestionReply *QPlaceManagerEngineNokiaV2::searchSuggestions(const unsupported |= query.visibilityScope() != QLocation::UnspecifiedVisibility && query.visibilityScope() != QLocation::PublicVisibility; - unsupported |= query.offset() > 0; unsupported |= !query.categories().isEmpty(); unsupported |= !query.recommendationId().isEmpty(); diff --git a/tests/auto/declarative_core/tst_placesearchmodel.qml b/tests/auto/declarative_core/tst_placesearchmodel.qml index f5223e4c..2020a4f8 100644 --- a/tests/auto/declarative_core/tst_placesearchmodel.qml +++ b/tests/auto/declarative_core/tst_placesearchmodel.qml @@ -101,7 +101,6 @@ TestCase { return [ { tag: "plugin", property: "plugin", signal: "pluginChanged", value: testPlugin }, { tag: "searchArea", property: "searchArea", signal: "searchAreaChanged", value: testSearchArea, reset: QtPositioning.shape() }, - { tag: "offset", property: "offset", signal: "offsetChanged", value: 10, reset: 0 }, { tag: "limit", property: "limit", signal: "limitChanged", value: 10, reset: -1 }, { tag: "searchTerm", property: "searchTerm", signal: "searchTermChanged", value: "Test term", reset: "" }, diff --git a/tests/auto/declarative_core/tst_placesearchsuggestionmodel.qml b/tests/auto/declarative_core/tst_placesearchsuggestionmodel.qml index 2d661b05..51f348e3 100644 --- a/tests/auto/declarative_core/tst_placesearchsuggestionmodel.qml +++ b/tests/auto/declarative_core/tst_placesearchsuggestionmodel.qml @@ -78,7 +78,6 @@ TestCase { return [ { tag: "plugin", property: "plugin", signal: "pluginChanged", value: testPlugin }, { tag: "searchArea", property: "searchArea", signal: "searchAreaChanged", value: testSearchArea, reset: QtPositioning.shape() }, - { tag: "offset", property: "offset", signal: "offsetChanged", value: 10, reset: 0 }, { tag: "limit", property: "limit", signal: "limitChanged", value: 10, reset: -1 }, { tag: "searchTerm", property: "searchTerm", signal: "searchTermChanged", value: "Test term", reset: "" }, @@ -86,7 +85,7 @@ TestCase { } function test_setAndGet(data) { - //Utils.testObjectProperties(testCase, testModel, data); + Utils.testObjectProperties(testCase, testModel, data); } SignalSpy { id: statusChangedSpy; target: testModel; signalName: "statusChanged" } diff --git a/tests/auto/nokia_services/places_semiauto/tst_places.cpp b/tests/auto/nokia_services/places_semiauto/tst_places.cpp index 82853a7f..b22fa573 100644 --- a/tests/auto/nokia_services/places_semiauto/tst_places.cpp +++ b/tests/auto/nokia_services/places_semiauto/tst_places.cpp @@ -518,17 +518,9 @@ void tst_QPlaceManagerNokia::suggestions_data() void tst_QPlaceManagerNokia::suggestionsMisc() { - //check providing an offset + //check providing a distance relevancy hint (should be ignored) QPlaceSearchRequest searchRequest; - searchRequest.setSearchArea(QGeoCircle(QGeoCoordinate(-27.5, 153))); - searchRequest.setSearchTerm(QStringLiteral("sus")); - searchRequest.setOffset(5); QStringList results; - QVERIFY(doSearchSuggestions(searchRequest, &results, QPlaceReply::BadArgumentError)); - QCOMPARE(results.count(), 0); - searchRequest.clear(); - - //check porviding a distance relevancy hint (should be ignored) searchRequest.setSearchArea(QGeoCircle(QGeoCoordinate(-27.5, 153))); searchRequest.setSearchTerm(QStringLiteral("sus")); searchRequest.setRelevanceHint(QPlaceSearchRequest::DistanceHint); diff --git a/tests/auto/qplacesearchreply/tst_qplacesearchreply.cpp b/tests/auto/qplacesearchreply/tst_qplacesearchreply.cpp index 24a76bc7..43638334 100644 --- a/tests/auto/qplacesearchreply/tst_qplacesearchreply.cpp +++ b/tests/auto/qplacesearchreply/tst_qplacesearchreply.cpp @@ -42,9 +42,11 @@ #include <QtCore/QString> #include <QtTest/QtTest> +#include <QtPositioning/QGeoCircle> +#include <QtLocation/QPlaceSearchRequest> #include <QtLocation/QPlaceSearchReply> #include <QtLocation/QPlaceResult> -#include <QtPositioning/QGeoCircle> + QT_USE_NAMESPACE @@ -101,7 +103,6 @@ void tst_QPlaceSearchReply::requestTest() TestSearchReply *reply = new TestSearchReply(this); QPlaceSearchRequest request; request.setLimit(10); - request.setOffset(50); QGeoCircle circle; circle.setCenter(QGeoCoordinate(10,20)); diff --git a/tests/auto/qplacesearchrequest/tst_qplacesearchrequest.cpp b/tests/auto/qplacesearchrequest/tst_qplacesearchrequest.cpp index 318e8353..bd7589dd 100644 --- a/tests/auto/qplacesearchrequest/tst_qplacesearchrequest.cpp +++ b/tests/auto/qplacesearchrequest/tst_qplacesearchrequest.cpp @@ -268,16 +268,14 @@ void tst_QPlaceSearchRequest::clearTest() category.setName("Fast Food"); req.setCategory(category); req.setLimit(100); - req.setOffset(5); req.clear(); QVERIFY(req.searchTerm().isEmpty()); QVERIFY(req.searchArea() == QGeoShape()); QVERIFY(req.categories().isEmpty()); QVERIFY(req.limit() == -1); - QVERIFY(req.offset() == 0); } -QTEST_APPLESS_MAIN(tst_QPlaceSearchRequest); +QTEST_APPLESS_MAIN(tst_QPlaceSearchRequest) #include "tst_qplacesearchrequest.moc" |