diff options
29 files changed, 223 insertions, 217 deletions
diff --git a/src/imports/location/declarativeplaces/qdeclarativemediamodel.cpp b/src/imports/location/declarativeplaces/qdeclarativemediamodel.cpp index 85fbb348..feb093cf 100644 --- a/src/imports/location/declarativeplaces/qdeclarativemediamodel.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativemediamodel.cpp @@ -156,7 +156,7 @@ void QDeclarativeMediaModel::fetchMore(const QModelIndex &parent) return; } - QPlaceQuery query; + QPlaceRequest query; if (m_mediaCount == -1) { query.setOffset(0); diff --git a/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp index bd07e127..5d60bf42 100644 --- a/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp @@ -4,6 +4,8 @@ #include <QtDeclarative/QDeclarativeInfo> #include <QtLocation/QGeoServiceProvider> +#include <qplacesearchreply.h> + QT_USE_NAMESPACE /*! diff --git a/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel_p.h b/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel_p.h index cb23f634..a5a5abbc 100644 --- a/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel_p.h +++ b/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel_p.h @@ -6,7 +6,7 @@ #include <QDeclarativeListProperty> #include <qplacemanager.h> -#include <qplacesearchquery.h> +#include <qplacesearchrequest.h> #include "qdeclarativecoordinate_p.h" #include "qdeclarativegeoboundingbox_p.h" @@ -87,7 +87,7 @@ private: QDeclarativeGeoBoundingArea *m_searchArea; QList<QDeclarativeSearchResult*> m_results; - QPlaceSearchQuery m_queryParameters; + QPlaceSearchRequest m_queryParameters; QPlaceSearchReply *m_response; diff --git a/src/imports/location/declarativeplaces/qdeclarativereviewmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativereviewmodel.cpp index 49ee7c82..8fbd9410 100644 --- a/src/imports/location/declarativeplaces/qdeclarativereviewmodel.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativereviewmodel.cpp @@ -155,7 +155,7 @@ void QDeclarativeReviewModel::fetchMore(const QModelIndex &parent) return; } - QPlaceQuery query; + QPlaceRequest query; if (m_reviewCount == -1) { query.setOffset(0); diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp index f7613c4e..300e17ad 100644 --- a/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp @@ -1,5 +1,6 @@ #include "qdeclarativesearchresultmodel_p.h" #include "qdeclarativegeoserviceprovider_p.h" +#include <qplacesearchreply.h> #include <QtDeclarative/QDeclarativeInfo> #include <QtLocation/QGeoServiceProvider> diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel_p.h b/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel_p.h index 83dfcc7d..ee971314 100644 --- a/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel_p.h +++ b/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel_p.h @@ -6,7 +6,7 @@ #include <QDeclarativeListProperty> #include <qplacemanager.h> -#include <qplacesearchquery.h> +#include <qplacesearchrequest.h> #include "qdeclarativegeoboundingarea_p.h" #include "qdeclarativesearchresult_p.h" @@ -99,7 +99,7 @@ private: QDeclarativeCategory m_category; QList<QDeclarativeSearchResult*> m_results; - QPlaceSearchQuery m_queryParameters; + QPlaceSearchRequest m_queryParameters; QPlaceSearchReply *m_response; diff --git a/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel.cpp index 6921bd2b..4116f46d 100644 --- a/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel.cpp @@ -5,7 +5,7 @@ #include <QtLocation/QGeoServiceProvider> #include <qplacemanager.h> -#include <qplacesearchquery.h> +#include <qplacesearchrequest.h> QT_USE_NAMESPACE diff --git a/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel_p.h b/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel_p.h index 72081aad..52dac692 100644 --- a/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel_p.h +++ b/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel_p.h @@ -4,7 +4,7 @@ #include <QObject> #include <QAbstractListModel> -#include <qplacesearchquery.h> +#include <qplacesearchrequest.h> #include <qplacemanager.h> #include <qplacetextpredictionreply.h> @@ -84,7 +84,7 @@ private: private: QDeclarativeGeoBoundingArea *m_searchArea; - QPlaceSearchQuery m_queryParameters; + QPlaceSearchRequest m_queryParameters; QPlaceTextPredictionReply *m_response; diff --git a/src/location/places/places.pri b/src/location/places/places.pri index b29247d6..dba44980 100644 --- a/src/location/places/places.pri +++ b/src/location/places/places.pri @@ -17,8 +17,8 @@ PUBLIC_HEADERS += \ #result places/qplacesearchresult.h \ #query classes - places/qplacequery.h \ - places/qplacesearchquery.h \ + places/qplacerequest.h \ + places/qplacesearchrequest.h \ #reply classes places/qplacereply.h \ places/qplacedetailsreply.h \ @@ -64,8 +64,8 @@ SOURCES += \ #result places/qplacesearchresult.cpp \ #query classes - places/qplacequery.cpp \ - places/qplacesearchquery.cpp \ + places/qplacerequest.cpp \ + places/qplacesearchrequest.cpp \ #reply classes places/qplacereply.cpp \ places/qplacedetailsreply.cpp \ diff --git a/src/location/places/qplacemanager.cpp b/src/location/places/qplacemanager.cpp index 23a8d7a6..ffa0875f 100644 --- a/src/location/places/qplacemanager.cpp +++ b/src/location/places/qplacemanager.cpp @@ -137,11 +137,11 @@ QPlaceDetailsReply *QPlaceManager::getPlaceDetails(const QString &placeId) const } /*! - Retrieves media from a given \a place according to the parameters specified in \a query. + Retrieves media from a given \a place according to the parameters specified in \a request. */ -QPlaceMediaReply *QPlaceManager::getMedia(const QGeoPlace &place, const QPlaceQuery &query) const +QPlaceMediaReply *QPlaceManager::getMedia(const QGeoPlace &place, const QPlaceRequest &request) const { - return d->engine->getMedia(place, query); + return d->engine->getMedia(place, request); } /*! @@ -153,35 +153,35 @@ QPlaceReply* QPlaceManager::postRating(const QString &placeId, qreal rating) } /*! - Returns reviews for a given \a place according to the parameters specified in \a query. + Returns reviews for a given \a place according to the parameters specified in \a request. */ -QPlaceReviewReply *QPlaceManager::getReviews(const QGeoPlace &place, const QPlaceQuery &query) const +QPlaceReviewReply *QPlaceManager::getReviews(const QGeoPlace &place, const QPlaceRequest &request) const { - return d->engine->getReviews(place, query); + return d->engine->getReviews(place, request); } /*! - Searches for places according to a given \a query. + Searches for places according to a given \a request. */ -QPlaceSearchReply *QPlaceManager::searchForPlaces(const QPlaceSearchQuery &query) const +QPlaceSearchReply *QPlaceManager::searchForPlaces(const QPlaceSearchRequest &request) const { - return d->engine->searchForPlaces(query); + return d->engine->searchForPlaces(request); } /*! - Provides recommendation based on a given \a place. + Provides recommendation based on a given \a request. */ -QPlaceSearchReply *QPlaceManager::recommendations(const QGeoPlace &place, const QPlaceSearchQuery &query) const +QPlaceSearchReply *QPlaceManager::recommendations(const QGeoPlace &place, const QPlaceSearchRequest &request) const { - return d->engine->recommendations(place, query); + return d->engine->recommendations(place, request); } /*! - Requests a set of text predictions for a given \a query string. + Requests a set of text predictions for a given \a request */ -QPlaceTextPredictionReply *QPlaceManager::textPredictions(const QPlaceSearchQuery &query) const +QPlaceTextPredictionReply *QPlaceManager::textPredictions(const QPlaceSearchRequest &request) const { - return d->engine->textPredictions(query); + return d->engine->textPredictions(request); } /*! diff --git a/src/location/places/qplacemanager.h b/src/location/places/qplacemanager.h index 01a9e05b..3e886a0a 100644 --- a/src/location/places/qplacemanager.h +++ b/src/location/places/qplacemanager.h @@ -45,10 +45,9 @@ #include "qmobilityglobal.h" #include "qplacemediaobject.h" #include "qplacemediareply.h" -#include "qplacequery.h" +#include "qplacerequest.h" #include "qplacesavereply.h" #include "qplacereply.h" -#include "qplacesearchreply.h" #include "qplacedetailsreply.h" #include "qplacereviewreply.h" #include "qplacetextpredictionreply.h" @@ -62,7 +61,8 @@ QT_BEGIN_NAMESPACE class QPlaceManagerEngine; -class QPlaceSearchQuery; +class QPlaceSearchRequest; +class QPlaceSearchReply; class QPlaceManagerPrivate; class Q_LOCATION_EXPORT QPlaceManager : public QObject @@ -112,15 +112,15 @@ public: QPlaceDetailsReply *getPlaceDetails(const QString &placeId) const; QPlaceReply *postRating(const QString &placeId, qreal value); - QPlaceReviewReply *getReviews(const QGeoPlace &place, const QPlaceQuery &query) const; + QPlaceReviewReply *getReviews(const QGeoPlace &place, const QPlaceRequest &query) const; - QPlaceMediaReply *getMedia(const QGeoPlace &place, const QPlaceQuery &query) const; + QPlaceMediaReply *getMedia(const QGeoPlace &place, const QPlaceRequest &query) const; - QPlaceSearchReply *searchForPlaces(const QPlaceSearchQuery &query) const; + QPlaceSearchReply *searchForPlaces(const QPlaceSearchRequest &query) const; - QPlaceSearchReply *recommendations(const QGeoPlace &place, const QPlaceSearchQuery &query) const; + QPlaceSearchReply *recommendations(const QGeoPlace &place, const QPlaceSearchRequest &query) const; - QPlaceTextPredictionReply *textPredictions(const QPlaceSearchQuery &query) const; + QPlaceTextPredictionReply *textPredictions(const QPlaceSearchRequest &query) const; ConnectivityModes connectivityMode() const; void setConnectivityMode(ConnectivityModes connectivityMode); diff --git a/src/location/places/qplacemanagerengine.h b/src/location/places/qplacemanagerengine.h index 39158311..ca9699e6 100644 --- a/src/location/places/qplacemanagerengine.h +++ b/src/location/places/qplacemanagerengine.h @@ -61,16 +61,16 @@ public: virtual QPlaceDetailsReply *getPlaceDetails(const QString &placeId) = 0; - virtual QPlaceMediaReply *getMedia(const QGeoPlace &place, const QPlaceQuery &query) = 0; + virtual QPlaceMediaReply *getMedia(const QGeoPlace &place, const QPlaceRequest &request) = 0; virtual QPlaceReply *postRating(const QString &placeId, qreal value) = 0; - virtual QPlaceReviewReply *getReviews(const QGeoPlace &place, const QPlaceQuery &query) = 0; + virtual QPlaceReviewReply *getReviews(const QGeoPlace &place, const QPlaceRequest &request) = 0; - virtual QPlaceSearchReply *searchForPlaces(const QPlaceSearchQuery &query) = 0; + virtual QPlaceSearchReply *searchForPlaces(const QPlaceSearchRequest &request) = 0; - virtual QPlaceSearchReply *recommendations(const QGeoPlace &place, const QPlaceSearchQuery &query) = 0; - virtual QPlaceTextPredictionReply *textPredictions(const QPlaceSearchQuery &query) = 0; + virtual QPlaceSearchReply *recommendations(const QGeoPlace &place, const QPlaceSearchRequest &request) = 0; + virtual QPlaceTextPredictionReply *textPredictions(const QPlaceSearchRequest &request) = 0; virtual QPlaceManager::ConnectivityModes connectivityMode() const = 0; virtual void setConnectivityMode(QPlaceManager::ConnectivityModes mode) = 0; diff --git a/src/location/places/qplacequery.cpp b/src/location/places/qplacerequest.cpp index 1d35ca19..bc7f10cf 100644 --- a/src/location/places/qplacequery.cpp +++ b/src/location/places/qplacerequest.cpp @@ -39,19 +39,19 @@ ** ****************************************************************************/ -#include "qplacequery.h" +#include "qplacerequest.h" QT_BEGIN_NAMESPACE -class QPlaceQueryPrivate : public QSharedData +class QPlaceRequestPrivate : public QSharedData { public: - QPlaceQueryPrivate(); - QPlaceQueryPrivate(const QPlaceQueryPrivate &other); + QPlaceRequestPrivate(); + QPlaceRequestPrivate(const QPlaceRequestPrivate &other); - ~QPlaceQueryPrivate(); + ~QPlaceRequestPrivate(); - bool operator==(const QPlaceQueryPrivate &other) const; + bool operator==(const QPlaceRequestPrivate &other) const; int offset; int limit; @@ -61,25 +61,25 @@ QT_END_NAMESPACE QT_USE_NAMESPACE -QPlaceQueryPrivate::QPlaceQueryPrivate() +QPlaceRequestPrivate::QPlaceRequestPrivate() : QSharedData(), offset(0), limit(-1) { } -QPlaceQueryPrivate::QPlaceQueryPrivate(const QPlaceQueryPrivate &other) +QPlaceRequestPrivate::QPlaceRequestPrivate(const QPlaceRequestPrivate &other) : QSharedData() { this->offset = other.offset; this->limit = other.limit; } -QPlaceQueryPrivate::~QPlaceQueryPrivate() +QPlaceRequestPrivate::~QPlaceRequestPrivate() { } -bool QPlaceQueryPrivate::operator==(const QPlaceQueryPrivate &other) const +bool QPlaceRequestPrivate::operator==(const QPlaceRequestPrivate &other) const { return ( this->offset == other.offset @@ -101,15 +101,15 @@ bool QPlaceQueryPrivate::operator==(const QPlaceQueryPrivate &other) const /*! Default constructor. Constructs an new query object. */ -QPlaceQuery::QPlaceQuery() - : d(new QPlaceQueryPrivate) +QPlaceRequest::QPlaceRequest() + : d(new QPlaceRequestPrivate) { } /*! Constructs a copy of \a other */ -QPlaceQuery::QPlaceQuery(const QPlaceQuery &other) +QPlaceRequest::QPlaceRequest(const QPlaceRequest &other) :d(other.d) { } @@ -117,16 +117,16 @@ QPlaceQuery::QPlaceQuery(const QPlaceQuery &other) /*! Destructor. */ -QPlaceQuery::~QPlaceQuery() +QPlaceRequest::~QPlaceRequest() { } -QPlaceQuery &QPlaceQuery::operator =(const QPlaceQuery &other) { +QPlaceRequest &QPlaceRequest::operator =(const QPlaceRequest &other) { d = other.d; return *this; } -bool QPlaceQuery::operator==(const QPlaceQuery &other) const +bool QPlaceRequest::operator==(const QPlaceRequest &other) const { return (*(d.constData()) == *(other.d.constData())); } @@ -138,7 +138,7 @@ bool QPlaceQuery::operator==(const QPlaceQuery &other) const Negative offests are treated as an offset of 0; */ -int QPlaceQuery::offset() const +int QPlaceRequest::offset() const { return d->offset; } @@ -146,7 +146,7 @@ int QPlaceQuery::offset() const /*! Sets the \a offset. */ -void QPlaceQuery::setOffset(int offset) +void QPlaceRequest::setOffset(int offset) { d->offset = offset; } @@ -156,7 +156,7 @@ void QPlaceQuery::setOffset(int offset) value of this limit is -1, indicating that the default limit of the backend should be used. */ -int QPlaceQuery::limit() const +int QPlaceRequest::limit() const { return d->limit; } @@ -170,7 +170,7 @@ int QPlaceQuery::limit() const (A limit of 0 will retrieve no places). */ -void QPlaceQuery::setLimit(int limit) +void QPlaceRequest::setLimit(int limit) { d->limit = limit; } @@ -178,7 +178,7 @@ void QPlaceQuery::setLimit(int limit) /*! Clears the parameters of the search query. */ -void QPlaceQuery::clear() +void QPlaceRequest::clear() { d->offset = 0; d->limit = -1; diff --git a/src/location/places/qplacequery.h b/src/location/places/qplacerequest.h index 257388e3..d520b052 100644 --- a/src/location/places/qplacequery.h +++ b/src/location/places/qplacerequest.h @@ -47,20 +47,20 @@ QT_BEGIN_NAMESPACE -class QPlaceQueryPrivate; +class QPlaceRequestPrivate; -class Q_LOCATION_EXPORT QPlaceQuery +class Q_LOCATION_EXPORT QPlaceRequest { public: - QPlaceQuery(); - QPlaceQuery(const QPlaceQuery &other); + QPlaceRequest(); + QPlaceRequest(const QPlaceRequest &other); - virtual ~QPlaceQuery(); + virtual ~QPlaceRequest(); - QPlaceQuery &operator=(const QPlaceQuery &other); + QPlaceRequest &operator=(const QPlaceRequest &other); - bool operator==(const QPlaceQuery &other) const; - bool operator!=(const QPlaceQuery &other) const { + bool operator==(const QPlaceRequest &other) const; + bool operator!=(const QPlaceRequest &other) const { return !(other == *this); } @@ -72,7 +72,7 @@ public: virtual void clear(); private: - QSharedDataPointer<QPlaceQueryPrivate> d; + QSharedDataPointer<QPlaceRequestPrivate> d; }; QT_END_NAMESPACE diff --git a/src/location/places/qplacesearchreply.h b/src/location/places/qplacesearchreply.h index 5a83eb5a..87e7a850 100644 --- a/src/location/places/qplacesearchreply.h +++ b/src/location/places/qplacesearchreply.h @@ -44,6 +44,7 @@ #include "qplacereply.h" #include "qplacesearchresult.h" +#include "qplacesearchrequest.h" QT_BEGIN_NAMESPACE diff --git a/src/location/places/qplacesearchquery.cpp b/src/location/places/qplacesearchrequest.cpp index 40beddc7..733a07f0 100644 --- a/src/location/places/qplacesearchquery.cpp +++ b/src/location/places/qplacesearchrequest.cpp @@ -39,20 +39,20 @@ ** ****************************************************************************/ -#include "qplacesearchquery.h" +#include "qplacesearchrequest.h" #include "qgeocoordinate.h" QT_BEGIN_NAMESPACE -class QPlaceSearchQueryPrivate : public QSharedData +class QPlaceSearchRequestPrivate : public QSharedData { public: - QPlaceSearchQueryPrivate(); - QPlaceSearchQueryPrivate(const QPlaceSearchQueryPrivate &other); + QPlaceSearchRequestPrivate(); + QPlaceSearchRequestPrivate(const QPlaceSearchRequestPrivate &other); - ~QPlaceSearchQueryPrivate(); + ~QPlaceSearchRequestPrivate(); - bool operator==(const QPlaceSearchQueryPrivate &other) const; + bool operator==(const QPlaceSearchRequestPrivate &other) const; QString searchTerm; QList<QPlaceCategory> categories; @@ -65,7 +65,7 @@ QT_END_NAMESPACE QT_USE_NAMESPACE -QPlaceSearchQueryPrivate::QPlaceSearchQueryPrivate() +QPlaceSearchRequestPrivate::QPlaceSearchRequestPrivate() : QSharedData(), dymNumber(0), searchArea(0), @@ -73,7 +73,7 @@ QPlaceSearchQueryPrivate::QPlaceSearchQueryPrivate() { } -QPlaceSearchQueryPrivate::QPlaceSearchQueryPrivate(const QPlaceSearchQueryPrivate &other) +QPlaceSearchRequestPrivate::QPlaceSearchRequestPrivate(const QPlaceSearchRequestPrivate &other) : QSharedData(), dymNumber(0) { @@ -85,13 +85,13 @@ QPlaceSearchQueryPrivate::QPlaceSearchQueryPrivate(const QPlaceSearchQueryPrivat this->scope = other.scope; } -QPlaceSearchQueryPrivate::~QPlaceSearchQueryPrivate() +QPlaceSearchRequestPrivate::~QPlaceSearchRequestPrivate() { delete searchArea; searchArea = 0; } -bool QPlaceSearchQueryPrivate::operator==(const QPlaceSearchQueryPrivate &other) const +bool QPlaceSearchRequestPrivate::operator==(const QPlaceSearchRequestPrivate &other) const { bool searchAreaMatch = false; if ((this->searchArea == 0) && (other.searchArea == 0)) { @@ -115,20 +115,21 @@ bool QPlaceSearchQueryPrivate::operator==(const QPlaceSearchQueryPrivate &other) } /*! - \class QPlaceSearchQuery + \class QPlaceSearchRequest \inmodule Location - \brief The QPlaceSearchQuery class represents a query parameters object. + \brief The QPlaceSearchRequest class represents the query parameters + of a search request. \ingroup places-main - The QSearchQuery class represents a query parameters object. Each - QSearchQuery cointans search query parameters like search term. + The QPlaceSearchRequest class represents a query parameters object. Each + QPlaceSearchRequest cointans search query parameters like search term. */ /*! - \enum QPlaceSearchQuery::RelevanceHint + \enum QPlaceSearchRequest::RelevanceHint Defines hints to help rank place results. \value DistanceHint @@ -141,19 +142,19 @@ bool QPlaceSearchQueryPrivate::operator==(const QPlaceSearchQueryPrivate &other) */ /*! - Default constructor. Constructs an new query object. + Default constructor. Constructs an new request object. */ -QPlaceSearchQuery::QPlaceSearchQuery() - : QPlaceQuery(), - d(new QPlaceSearchQueryPrivate) +QPlaceSearchRequest::QPlaceSearchRequest() + : QPlaceRequest(), + d(new QPlaceSearchRequestPrivate) { } /*! Constructs a copy of \a other */ -QPlaceSearchQuery::QPlaceSearchQuery(const QPlaceSearchQuery &other) - : QPlaceQuery(other), +QPlaceSearchRequest::QPlaceSearchRequest(const QPlaceSearchRequest &other) + : QPlaceRequest(other), d(other.d) { } @@ -161,19 +162,19 @@ QPlaceSearchQuery::QPlaceSearchQuery(const QPlaceSearchQuery &other) /*! Destructor. */ -QPlaceSearchQuery::~QPlaceSearchQuery() +QPlaceSearchRequest::~QPlaceSearchRequest() { } -QPlaceSearchQuery &QPlaceSearchQuery::operator =(const QPlaceSearchQuery &other) { - this->QPlaceQuery::operator =(other); +QPlaceSearchRequest &QPlaceSearchRequest::operator =(const QPlaceSearchRequest &other) { + this->QPlaceRequest::operator =(other); d = other.d; return *this; } -bool QPlaceSearchQuery::operator==(const QPlaceSearchQuery &other) const +bool QPlaceSearchRequest::operator==(const QPlaceSearchRequest &other) const { - return (this->QPlaceQuery::operator ==(other) + return (this->QPlaceRequest::operator ==(other) && (*(d.constData()) == *(other.d.constData()))); } @@ -181,7 +182,7 @@ bool QPlaceSearchQuery::operator==(const QPlaceSearchQuery &other) const /*! Returns the search term. */ -QString QPlaceSearchQuery::searchTerm() const +QString QPlaceSearchRequest::searchTerm() const { return d->searchTerm; } @@ -189,25 +190,25 @@ QString QPlaceSearchQuery::searchTerm() const /*! Sets the search \a term. */ -void QPlaceSearchQuery::setSearchTerm(const QString &term) +void QPlaceSearchRequest::setSearchTerm(const QString &term) { d->searchTerm = term; } /*! - Return the categories to be used in the search query. + Return the categories to be used in the search request. Places need only to belong to one of the categories - to be considered a match by the query. + to be considered a match by the request. */ -QList<QPlaceCategory> QPlaceSearchQuery::categories() const +QList<QPlaceCategory> QPlaceSearchRequest::categories() const { return d->categories; } /*! - Sets the search query to search by a single \a category + Sets the search request to search by a single \a category */ -void QPlaceSearchQuery::setCategory(const QPlaceCategory &category) +void QPlaceSearchRequest::setCategory(const QPlaceCategory &category) { d->categories.clear(); @@ -218,17 +219,17 @@ void QPlaceSearchQuery::setCategory(const QPlaceCategory &category) /*! Returns search area. The default search area is a null pointer. */ -QGeoBoundingArea *QPlaceSearchQuery::searchArea() const +QGeoBoundingArea *QPlaceSearchRequest::searchArea() const { return d->searchArea; } /*! - Sets the search query to search within the given \a area. Ownership of the is - transferred to the place query who is responsible for pointer deletion. If a new \a area + Sets the search request to search within the given \a area. Ownership of the \a area is + transferred to the request who is responsible for pointer deletion. If a new \a area is being assigned, the old area is deleted. */ -void QPlaceSearchQuery::setSearchArea(QGeoBoundingArea *area) +void QPlaceSearchRequest::setSearchArea(QGeoBoundingArea *area) { if (d->searchArea != area) delete d->searchArea; @@ -237,17 +238,17 @@ void QPlaceSearchQuery::setSearchArea(QGeoBoundingArea *area) } /*! - Returns maximum number of "did you mean" suggestions returned by search query. + Returns maximum number of "did you mean" suggestions returned by search request. */ -int QPlaceSearchQuery::didYouMeanSuggestionNumber() const +int QPlaceSearchRequest::didYouMeanSuggestionNumber() const { return d->dymNumber; } /*! - Sets maximum \a number of "did you mean" suggestions returned by search query. + Sets maximum \a number of "did you mean" suggestions returned by search request. */ -void QPlaceSearchQuery::setDidYouMeanSuggestionNumber(const int &number) +void QPlaceSearchRequest::setDidYouMeanSuggestionNumber(const int &number) { d->dymNumber = number; } @@ -258,7 +259,7 @@ void QPlaceSearchQuery::setDidYouMeanSuggestionNumber(const int &number) It is up to the manager implementation to decide what scope it searches by default. */ -QPlaceManager::VisibilityScopes QPlaceSearchQuery::visibilityScope() const +QPlaceManager::VisibilityScopes QPlaceSearchRequest::visibilityScope() const { return d->scope; } @@ -266,19 +267,21 @@ QPlaceManager::VisibilityScopes QPlaceSearchQuery::visibilityScope() const /*! Sets the \a scope used when searching for places. */ -void QPlaceSearchQuery::setVisibilityScope(QPlaceManager::VisibilityScopes scope) +void QPlaceSearchRequest::setVisibilityScope(QPlaceManager::VisibilityScopes scope) { d->scope = scope; } /*! - Clears the parameters of the search query. + Clears the parameters of the search request. */ -void QPlaceSearchQuery::clear() +void QPlaceSearchRequest::clear() { - QPlaceQuery::clear(); + QPlaceRequest::clear(); d->searchTerm.clear(); d->categories.clear(); + if (d->searchArea) + delete d->searchArea; d->searchArea = 0; d->dymNumber = 0; d->scope = QPlaceManager::NoScope; diff --git a/src/location/places/qplacesearchquery.h b/src/location/places/qplacesearchrequest.h index bfbbd668..463da0fd 100644 --- a/src/location/places/qplacesearchquery.h +++ b/src/location/places/qplacesearchrequest.h @@ -39,23 +39,23 @@ ** ****************************************************************************/ -#ifndef QPLACESEARCHQUERY_H -#define QPLACESEARCHQUERY_H +#ifndef QPLACESEARCHREQUEST_H +#define QPLACESEARCHREQUEST_H #include <QSharedDataPointer> #include "qgeoboundingarea.h" #include "qmobilityglobal.h" #include "qplacecategory.h" -#include "qplacequery.h" +#include "qplacerequest.h" #include "qplacemanager.h" #include <QString> QT_BEGIN_NAMESPACE -class QPlaceSearchQueryPrivate; +class QPlaceSearchRequestPrivate; -class Q_LOCATION_EXPORT QPlaceSearchQuery : public QPlaceQuery +class Q_LOCATION_EXPORT QPlaceSearchRequest : public QPlaceRequest { public: enum RelevanceHint { @@ -64,15 +64,15 @@ public: AlphabetHint }; - QPlaceSearchQuery(); - QPlaceSearchQuery(const QPlaceSearchQuery &other); + QPlaceSearchRequest(); + QPlaceSearchRequest(const QPlaceSearchRequest &other); - virtual ~QPlaceSearchQuery(); + virtual ~QPlaceSearchRequest(); - QPlaceSearchQuery &operator=(const QPlaceSearchQuery &other); + QPlaceSearchRequest &operator=(const QPlaceSearchRequest &other); - bool operator==(const QPlaceSearchQuery &other) const; - bool operator!=(const QPlaceSearchQuery &other) const { + bool operator==(const QPlaceSearchRequest &other) const; + bool operator!=(const QPlaceSearchRequest &other) const { return !(other == *this); } @@ -94,7 +94,7 @@ public: void clear(); private: - QSharedDataPointer<QPlaceSearchQueryPrivate> d; + QSharedDataPointer<QPlaceSearchRequestPrivate> d; }; QT_END_NAMESPACE diff --git a/src/plugins/geoservices/nokia/places/qplacerestmanager.cpp b/src/plugins/geoservices/nokia/places/qplacerestmanager.cpp index cde0b8cb..a95bdd6d 100644 --- a/src/plugins/geoservices/nokia/places/qplacerestmanager.cpp +++ b/src/plugins/geoservices/nokia/places/qplacerestmanager.cpp @@ -51,7 +51,6 @@ #include <QtNetwork> #include <QHash> -#include <qplacesearchquery.h> #include <qgeoboundingcircle.h> #include <qgeoboundingbox.h> #include "qplacerestreply.h" @@ -132,7 +131,7 @@ QPlaceRestReply *QPlaceRestManager::sendPlaceRequest(const QString &placeId) return sendGeneralRequest(placeServer + placeId); } -QPlaceRestReply *QPlaceRestManager::sendPlaceImagesRequest(const QString &placeId, const QPlaceQuery ¶ms) +QPlaceRestReply *QPlaceRestManager::sendPlaceImagesRequest(const QString &placeId, const QPlaceRequest ¶ms) { QString query = placeServer + placeId + images; if (params.offset() > -1) { @@ -147,7 +146,7 @@ QPlaceRestReply *QPlaceRestManager::sendPlaceImagesRequest(const QString &placeI /*! Predefines a review request and executes sendGeneralRequest(). */ -QPlaceRestReply *QPlaceRestManager::sendPlaceReviewRequest(const QString &placeId, const QPlaceQuery ¶ms) +QPlaceRestReply *QPlaceRestManager::sendPlaceReviewRequest(const QString &placeId, const QPlaceRequest ¶ms) { QString query = placeServer + placeId + reviews; if (params.offset() > -1) { @@ -163,7 +162,7 @@ QPlaceRestReply *QPlaceRestManager::sendPlaceReviewRequest(const QString &placeI /*! Predefines a recomendation request and executes sendGeneralRequest(). */ -QPlaceRestReply *QPlaceRestManager::sendRecommendationRequest(const QPlaceSearchQuery &query, const QString &userId) +QPlaceRestReply *QPlaceRestManager::sendRecommendationRequest(const QPlaceSearchRequest &query, const QString &userId) { Q_UNUSED(userId); return sendGeneralRequest(placeServer + query.searchTerm() + recomendation); @@ -180,7 +179,7 @@ QPlaceRestReply *QPlaceRestManager::sendCategoriesTreeRequest() /*! Predefines a suggestion request and executes sendGeneralRequest(). */ -QPlaceRestReply *QPlaceRestManager::sendSuggestionRequest(const QPlaceSearchQuery &query) +QPlaceRestReply *QPlaceRestManager::sendSuggestionRequest(const QPlaceSearchRequest &query) { return sendGeneralRequest(prepareSearchRequest(query) + const_query + query.searchTerm() + "&lh=1"); @@ -189,7 +188,7 @@ QPlaceRestReply *QPlaceRestManager::sendSuggestionRequest(const QPlaceSearchQuer /*! Predefines a search request and executes sendGeneralRequest(). */ -QPlaceRestReply *QPlaceRestManager::sendSearchRequest(const QPlaceSearchQuery &query) +QPlaceRestReply *QPlaceRestManager::sendSearchRequest(const QPlaceSearchRequest &query) { return sendGeneralRequest(prepareSearchRequest(query) + const_query + query.searchTerm()); @@ -258,7 +257,7 @@ QPlaceRestReply *QPlaceRestManager::sendGeneralRequest(const QUrl &url) /*! Returns prepared search string. */ -QString QPlaceRestManager::prepareSearchRequest(const QPlaceSearchQuery &query) +QString QPlaceRestManager::prepareSearchRequest(const QPlaceSearchRequest &query) { QString searchString(searchServer); // add view and device parameters diff --git a/src/plugins/geoservices/nokia/places/qplacerestmanager.h b/src/plugins/geoservices/nokia/places/qplacerestmanager.h index 35acdf9b..9aa4c2b7 100644 --- a/src/plugins/geoservices/nokia/places/qplacerestmanager.h +++ b/src/plugins/geoservices/nokia/places/qplacerestmanager.h @@ -56,7 +56,7 @@ #include <QtNetwork/QNetworkReply> #include <qmobilityglobal.h> -#include <qplacesearchquery.h> +#include <qplacesearchrequest.h> #include "qplacerestreply.h" QT_BEGIN_NAMESPACE @@ -69,12 +69,12 @@ public: static QPlaceRestManager *instance(); QPlaceRestReply *sendPlaceRequest(const QString &placeId); - QPlaceRestReply *sendPlaceImagesRequest(const QString &placeId, const QPlaceQuery ¶ms); - QPlaceRestReply *sendPlaceReviewRequest(const QString &placeId, const QPlaceQuery ¶ms); - QPlaceRestReply *sendRecommendationRequest(const QPlaceSearchQuery &query, const QString &userId); + QPlaceRestReply *sendPlaceImagesRequest(const QString &placeId, const QPlaceRequest ¶ms); + QPlaceRestReply *sendPlaceReviewRequest(const QString &placeId, const QPlaceRequest ¶ms); + QPlaceRestReply *sendRecommendationRequest(const QPlaceSearchRequest &query, const QString &userId); QPlaceRestReply *sendCategoriesTreeRequest(); - QPlaceRestReply *sendSearchRequest(const QPlaceSearchQuery &query); - QPlaceRestReply *sendSuggestionRequest(const QPlaceSearchQuery &query); + QPlaceRestReply *sendSearchRequest(const QPlaceSearchRequest &query); + QPlaceRestReply *sendSuggestionRequest(const QPlaceSearchRequest &query); QPlaceRestReply *postRatingRequest(const QString &placeId, const QString &userId, const int &value); QLocale locale() const; @@ -88,7 +88,7 @@ private: return sendGeneralRequest(QUrl(url)); } - QString prepareSearchRequest(const QPlaceSearchQuery &query); + QString prepareSearchRequest(const QPlaceSearchRequest &query); private: QNetworkAccessManager *mManager; diff --git a/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp index 8ecc52ef..bbff2c97 100644 --- a/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp +++ b/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.cpp @@ -94,7 +94,7 @@ QPlaceDetailsReply *QPlaceManagerEngineNokia::getPlaceDetails(const QString &pla return reply; } -QPlaceMediaReply *QPlaceManagerEngineNokia::getMedia(const QGeoPlace &place, const QPlaceQuery &query) +QPlaceMediaReply *QPlaceManagerEngineNokia::getMedia(const QGeoPlace &place, const QPlaceRequest &query) { QPlaceMediaReplyImpl *reply = NULL; QPlaceRestReply *restReply = QPlaceRestManager::instance()->sendPlaceImagesRequest(place.placeId(), @@ -127,7 +127,7 @@ QPlaceReply *QPlaceManagerEngineNokia::postRating(const QString &placeId, qreal return reply; } -QPlaceReviewReply *QPlaceManagerEngineNokia::getReviews(const QGeoPlace &place, const QPlaceQuery &query) +QPlaceReviewReply *QPlaceManagerEngineNokia::getReviews(const QGeoPlace &place, const QPlaceRequest &query) { QPlaceReviewReplyImpl *reply = NULL; QPlaceRestReply *restReply = QPlaceRestManager::instance()->sendPlaceReviewRequest(place.placeId(), @@ -143,11 +143,11 @@ QPlaceReviewReply *QPlaceManagerEngineNokia::getReviews(const QGeoPlace &place, return reply; } -QPlaceSearchReply *QPlaceManagerEngineNokia::searchForPlaces(const QPlaceSearchQuery &query) +QPlaceSearchReply *QPlaceManagerEngineNokia::searchForPlaces(const QPlaceSearchRequest &query) { //TODO: handling of scope QPlaceSearchReplyImpl *reply = NULL; - QPlaceSearchQuery newQuery = query; + QPlaceSearchRequest newQuery = query; // search by category if (newQuery.categories().count()) { newQuery.setSearchTerm(query.categories().at(0).name()); @@ -177,10 +177,10 @@ QPlaceSearchReply *QPlaceManagerEngineNokia::searchForPlaces(const QPlaceSearchQ return reply; } -QPlaceSearchReply *QPlaceManagerEngineNokia::recommendations(const QGeoPlace &place, const QPlaceSearchQuery &query) +QPlaceSearchReply *QPlaceManagerEngineNokia::recommendations(const QGeoPlace &place, const QPlaceSearchRequest &query) { QPlaceRecommendationReplyImpl *reply = NULL; - QPlaceSearchQuery newQuery = query; + QPlaceSearchRequest newQuery = query; newQuery.setSearchTerm(place.placeId()); QPlaceRestReply *restReply = QPlaceRestManager::instance()->sendRecommendationRequest(newQuery, QString()); if (restReply) { @@ -193,7 +193,7 @@ QPlaceSearchReply *QPlaceManagerEngineNokia::recommendations(const QGeoPlace &pl return reply; } -QPlaceTextPredictionReply *QPlaceManagerEngineNokia::textPredictions(const QPlaceSearchQuery &query) +QPlaceTextPredictionReply *QPlaceManagerEngineNokia::textPredictions(const QPlaceSearchRequest &query) { QPlaceTextPredictionReplyImpl *reply = NULL; QPlaceRestReply *restReply = QPlaceRestManager::instance()->sendSuggestionRequest(query); diff --git a/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h b/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h index 8962562c..520e4064 100644 --- a/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h +++ b/src/plugins/geoservices/nokia/qplacemanagerengine_nokia.h @@ -66,16 +66,16 @@ public: QPlaceDetailsReply *getPlaceDetails(const QString &placeId); - QPlaceMediaReply *getMedia(const QGeoPlace &place, const QPlaceQuery &query); + QPlaceMediaReply *getMedia(const QGeoPlace &place, const QPlaceRequest &query); QPlaceReply *postRating(const QString &placeId, qreal value); - QPlaceReviewReply *getReviews(const QGeoPlace &place, const QPlaceQuery &query); + QPlaceReviewReply *getReviews(const QGeoPlace &place, const QPlaceRequest &query); - QPlaceSearchReply *searchForPlaces(const QPlaceSearchQuery &query); + QPlaceSearchReply *searchForPlaces(const QPlaceSearchRequest &query); - QPlaceSearchReply *recommendations(const QGeoPlace &place, const QPlaceSearchQuery &query); - QPlaceTextPredictionReply *textPredictions(const QPlaceSearchQuery &query); + QPlaceSearchReply *recommendations(const QGeoPlace &place, const QPlaceSearchRequest &query); + QPlaceTextPredictionReply *textPredictions(const QPlaceSearchRequest &query); QPlaceManager::ConnectivityModes connectivityMode() const; void setConnectivityMode(QPlaceManager::ConnectivityModes connectivityMode); diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 68e44d19..d248ff8b 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -22,10 +22,10 @@ SUBDIRS += geotestplugin \ qplacemanager \ qplacemediaobject \ qplaceperiod \ - qplacequery \ + qplacerequest \ qplacerating \ qplacereview \ - qplacesearchquery \ + qplacesearchrequest \ qplacesupplier \ qplaceweekdayhours \ declarative diff --git a/tests/auto/geotestplugin/qplacemanagerengine_test.h b/tests/auto/geotestplugin/qplacemanagerengine_test.h index aa1317bf..f0683c73 100644 --- a/tests/auto/geotestplugin/qplacemanagerengine_test.h +++ b/tests/auto/geotestplugin/qplacemanagerengine_test.h @@ -77,7 +77,7 @@ public: return 0; } - QPlaceMediaReply *getMedia(const QGeoPlace &place, const QPlaceQuery &query) + QPlaceMediaReply *getMedia(const QGeoPlace &place, const QPlaceRequest &query) { Q_UNUSED(place) Q_UNUSED(query) @@ -93,7 +93,7 @@ public: return 0; } - QPlaceReviewReply *getReviews(const QGeoPlace &place, const QPlaceQuery &query) + QPlaceReviewReply *getReviews(const QGeoPlace &place, const QPlaceRequest &query) { Q_UNUSED(place) Q_UNUSED(query) @@ -101,14 +101,14 @@ public: return 0; } - QPlaceSearchReply *searchForPlaces(const QPlaceSearchQuery &query) + QPlaceSearchReply *searchForPlaces(const QPlaceSearchRequest &query) { Q_UNUSED(query) return 0; } - QPlaceSearchReply *recommendations(const QGeoPlace &place, const QPlaceSearchQuery &query) + QPlaceSearchReply *recommendations(const QGeoPlace &place, const QPlaceSearchRequest &query) { Q_UNUSED(place) Q_UNUSED(query) @@ -116,7 +116,7 @@ public: return 0; } - QPlaceTextPredictionReply *textPredictions(const QPlaceSearchQuery &query) + QPlaceTextPredictionReply *textPredictions(const QPlaceSearchRequest &query) { Q_UNUSED(query) diff --git a/tests/auto/qplacequery/qplacequery.pro b/tests/auto/qplacequery/qplacequery.pro deleted file mode 100644 index 8b8ea512..00000000 --- a/tests/auto/qplacequery/qplacequery.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE = app -CONFIG += testcase -TARGET = tst_qplacequery - -SOURCES += tst_qplacequery.cpp - -QT += location testlib diff --git a/tests/auto/qplacerequest/qplacerequest.pro b/tests/auto/qplacerequest/qplacerequest.pro new file mode 100644 index 00000000..e19aeee1 --- /dev/null +++ b/tests/auto/qplacerequest/qplacerequest.pro @@ -0,0 +1,7 @@ +TEMPLATE = app +CONFIG += testcase +TARGET = tst_qplacerequest + +SOURCES += tst_qplacerequest.cpp + +QT += location testlib diff --git a/tests/auto/qplacequery/tst_qplacequery.cpp b/tests/auto/qplacerequest/tst_qplacerequest.cpp index c9f2f7f8..810dd958 100644 --- a/tests/auto/qplacequery/tst_qplacequery.cpp +++ b/tests/auto/qplacerequest/tst_qplacerequest.cpp @@ -1,16 +1,16 @@ #include <QtCore/QString> #include <QtTest/QtTest> -#include <qplacequery.h> +#include <qplacerequest.h> QT_USE_NAMESPACE -class tst_QPlaceQuery : public QObject +class tst_QPlaceRequest : public QObject { Q_OBJECT public: - tst_QPlaceQuery(); + tst_QPlaceRequest(); private Q_SLOTS: void constructorTest(); @@ -19,16 +19,16 @@ private Q_SLOTS: void operatorsTest(); }; -tst_QPlaceQuery::tst_QPlaceQuery() +tst_QPlaceRequest::tst_QPlaceRequest() { } -void tst_QPlaceQuery::constructorTest() +void tst_QPlaceRequest::constructorTest() { - QPlaceQuery testObj; + QPlaceRequest testObj; Q_UNUSED(testObj); - QPlaceQuery *testObjPtr = new QPlaceQuery(testObj); + QPlaceRequest *testObjPtr = new QPlaceRequest(testObj); QVERIFY2(testObjPtr != NULL, "Copy constructor - null"); QVERIFY2(testObjPtr->offset() == 0, "Copy constructor - wrong count"); QVERIFY2(testObjPtr->limit() == -1, "Copy constructor - wrong value"); @@ -36,9 +36,9 @@ void tst_QPlaceQuery::constructorTest() delete testObjPtr; } -void tst_QPlaceQuery::offsetTest() +void tst_QPlaceRequest::offsetTest() { - QPlaceQuery testObj; + QPlaceRequest testObj; QVERIFY2(testObj.offset() == 0, "Wrong default value"); testObj.setOffset(-10); QVERIFY2(testObj.offset() == -10, "Wrong negative value returned"); @@ -48,9 +48,9 @@ void tst_QPlaceQuery::offsetTest() QVERIFY2(testObj.offset() == 0, "Wrong cleared value returned"); } -void tst_QPlaceQuery::limitTest() +void tst_QPlaceRequest::limitTest() { - QPlaceQuery testObj; + QPlaceRequest testObj; QVERIFY2(testObj.limit() == -1, "Wrong default value"); testObj.setLimit(-10); QVERIFY2(testObj.limit() == -10, "Wrong negative value returned"); @@ -60,17 +60,17 @@ void tst_QPlaceQuery::limitTest() QVERIFY2(testObj.limit() == -1, "Wrong cleared value returned"); } -void tst_QPlaceQuery::operatorsTest() +void tst_QPlaceRequest::operatorsTest() { - QPlaceQuery testObj; + QPlaceRequest testObj; testObj.setOffset(2); - QPlaceQuery testObj2; + QPlaceRequest testObj2; testObj2 = testObj; QVERIFY2(testObj == testObj2, "Not copied correctly"); testObj2.setLimit(-10); QVERIFY2(testObj != testObj2, "Object should be different"); } -QTEST_APPLESS_MAIN(tst_QPlaceQuery); +QTEST_APPLESS_MAIN(tst_QPlaceRequest); -#include "tst_qplacequery.moc" +#include "tst_qplacerequest.moc" diff --git a/tests/auto/qplacesearchquery/qplacesearchquery.pro b/tests/auto/qplacesearchquery/qplacesearchquery.pro deleted file mode 100644 index a4fd450d..00000000 --- a/tests/auto/qplacesearchquery/qplacesearchquery.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = app -CONFIG += testcase -TARGET = tst_qplacesearchquery -SOURCES += tst_qplacesearchquery.cpp - -QT += location testlib diff --git a/tests/auto/qplacesearchrequest/qplacesearchrequest.pro b/tests/auto/qplacesearchrequest/qplacesearchrequest.pro new file mode 100644 index 00000000..45d5d1a5 --- /dev/null +++ b/tests/auto/qplacesearchrequest/qplacesearchrequest.pro @@ -0,0 +1,6 @@ +TEMPLATE = app +CONFIG += testcase +TARGET = tst_qplacesearchrequest +SOURCES += tst_qplacesearchrequest.cpp + +QT += location testlib diff --git a/tests/auto/qplacesearchquery/tst_qplacesearchquery.cpp b/tests/auto/qplacesearchrequest/tst_qplacesearchrequest.cpp index b8197e51..8e2e7655 100644 --- a/tests/auto/qplacesearchquery/tst_qplacesearchquery.cpp +++ b/tests/auto/qplacesearchrequest/tst_qplacesearchrequest.cpp @@ -1,18 +1,18 @@ #include <QtCore/QString> #include <QtTest/QtTest> -#include <qplacesearchquery.h> +#include <qplacesearchrequest.h> #include <qgeoboundingcircle.h> #include <qgeoboundingbox.h> QT_USE_NAMESPACE -class tst_QPlaceSearchQuery : public QObject +class tst_QPlaceSearchRequest : public QObject { Q_OBJECT public: - tst_QPlaceSearchQuery(); + tst_QPlaceSearchRequest(); private Q_SLOTS: void constructorTest(); @@ -26,32 +26,32 @@ private Q_SLOTS: void operatorsTest(); }; -tst_QPlaceSearchQuery::tst_QPlaceSearchQuery() +tst_QPlaceSearchRequest::tst_QPlaceSearchRequest() { } -void tst_QPlaceSearchQuery::constructorTest() +void tst_QPlaceSearchRequest::constructorTest() { - QPlaceSearchQuery testObj; + QPlaceSearchRequest testObj; Q_UNUSED(testObj); - QPlaceSearchQuery *testObjPtr = new QPlaceSearchQuery(testObj); + QPlaceSearchRequest *testObjPtr = new QPlaceSearchRequest(testObj); QVERIFY2(testObjPtr != NULL, "Copy constructor - null"); QVERIFY2(*testObjPtr == testObj, "Copy constructor - compare"); delete testObjPtr; } -void tst_QPlaceSearchQuery::searchTermTest() +void tst_QPlaceSearchRequest::searchTermTest() { - QPlaceSearchQuery testObj; + QPlaceSearchRequest testObj; QVERIFY2(testObj.searchTerm() == QString(), "Wrong default value"); testObj.setSearchTerm("testText"); QVERIFY2(testObj.searchTerm() == "testText", "Wrong value returned"); } -void tst_QPlaceSearchQuery::categoriesTest() +void tst_QPlaceSearchRequest::categoriesTest() { - QPlaceSearchQuery testObj; + QPlaceSearchRequest testObj; QVERIFY2(testObj.categories().count() == 0, "Wrong default value"); QPlaceCategory cat; cat.setCategoryId("45346"); @@ -63,9 +63,9 @@ void tst_QPlaceSearchQuery::categoriesTest() QVERIFY(testObj.categories().isEmpty()); } -void tst_QPlaceSearchQuery::boundingCircleTest() +void tst_QPlaceSearchRequest::boundingCircleTest() { - QPlaceSearchQuery query; + QPlaceSearchRequest query; QVERIFY2(query.searchArea() == NULL, "Wrong default value"); QGeoBoundingCircle *circle = new QGeoBoundingCircle; circle->setCenter(QGeoCoordinate(30,20)); @@ -83,9 +83,9 @@ void tst_QPlaceSearchQuery::boundingCircleTest() QVERIFY2(query.searchArea() == NULL, "Search area not cleared"); } -void tst_QPlaceSearchQuery::boundingBoxTest() +void tst_QPlaceSearchRequest::boundingBoxTest() { - QPlaceSearchQuery query; + QPlaceSearchRequest query; QVERIFY2(query.searchArea() == NULL, "Wrong default value"); QGeoBoundingBox *box = new QGeoBoundingBox; @@ -105,10 +105,10 @@ void tst_QPlaceSearchQuery::boundingBoxTest() QVERIFY2(query.searchArea() == NULL, "Wrong cleared value returned"); } -void tst_QPlaceSearchQuery::searchAreaTest() +void tst_QPlaceSearchRequest::searchAreaTest() { //test assignment of new search area over an old search area - QPlaceSearchQuery *query = new QPlaceSearchQuery; + QPlaceSearchRequest *query = new QPlaceSearchRequest; QGeoBoundingCircle *circle = new QGeoBoundingCircle; circle->setCenter(QGeoCoordinate(30,20)); circle->setRadius(500.0); @@ -122,9 +122,9 @@ void tst_QPlaceSearchQuery::searchAreaTest() QVERIFY2(query->searchArea() == box, "New search area not assigned"); } -void tst_QPlaceSearchQuery::didYouMeanSuggestionNumberTest() +void tst_QPlaceSearchRequest::didYouMeanSuggestionNumberTest() { - QPlaceSearchQuery testObj; + QPlaceSearchRequest testObj; QVERIFY2(testObj.didYouMeanSuggestionNumber() == 0, "Wrong default value"); testObj.setDidYouMeanSuggestionNumber(10); QVERIFY2(testObj.didYouMeanSuggestionNumber() == 10, "Wrong value returned"); @@ -132,9 +132,9 @@ void tst_QPlaceSearchQuery::didYouMeanSuggestionNumberTest() QVERIFY2(testObj.didYouMeanSuggestionNumber() == 0, "Wrong cleared value returned"); } -void tst_QPlaceSearchQuery::visibilityScopeTest() +void tst_QPlaceSearchRequest::visibilityScopeTest() { - QPlaceSearchQuery query; + QPlaceSearchRequest query; QVERIFY2(query.visibilityScope() == QPlaceManager::NoScope, "Wrong default value"); query.setVisibilityScope(QPlaceManager::PublicScope); QCOMPARE(query.visibilityScope(), QPlaceManager::PublicScope); @@ -143,11 +143,11 @@ void tst_QPlaceSearchQuery::visibilityScopeTest() QVERIFY(query.visibilityScope() & QPlaceManager::PrivateScope); } -void tst_QPlaceSearchQuery::operatorsTest() +void tst_QPlaceSearchRequest::operatorsTest() { - QPlaceSearchQuery testObj; + QPlaceSearchRequest testObj; testObj.setSearchTerm("testValue"); - QPlaceSearchQuery testObj2; + QPlaceSearchRequest testObj2; testObj2 = testObj; QVERIFY2(testObj == testObj2, "Not copied correctly"); testObj2.setDidYouMeanSuggestionNumber(-5); @@ -200,6 +200,6 @@ void tst_QPlaceSearchQuery::operatorsTest() QVERIFY2(testObj != testObj2, "Different scopes identified as matching"); } -QTEST_APPLESS_MAIN(tst_QPlaceSearchQuery); +QTEST_APPLESS_MAIN(tst_QPlaceSearchRequest); -#include "tst_qplacesearchquery.moc" +#include "tst_qplacesearchrequest.moc" |