summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativebusinessinformation.cpp26
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativebusinessinformation_p.h2
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativecategory.cpp10
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativecategory_p.h2
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativedescription.cpp6
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativedescription_p.h2
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativemediaobject.cpp7
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativemediaobject_p.h2
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativemediapaginationlist.cpp8
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplace.cpp78
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplace_p.h8
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplacemanager.cpp4
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativerating.cpp6
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativerating_p.h6
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp3
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativereview.cpp12
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativereview_p.h8
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesearchresult.cpp6
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesearchresult_p.h2
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp13
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel.cpp4
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeweekdayhours.cpp6
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeweekdayhours_p.h2
-rw-r--r--src/imports/location/qdeclarativegeolocation.cpp35
-rw-r--r--src/imports/location/qdeclarativegeolocation_p.h8
-rw-r--r--src/location/places/qplacerating.cpp4
-rw-r--r--src/location/places/qplacerating.h6
-rw-r--r--src/location/places/qplacereview.cpp4
-rw-r--r--src/location/places/qplacereview.h4
-rw-r--r--src/location/places/qplacereview_p.h2
-rw-r--r--src/location/qgeoplace.cpp6
-rw-r--r--src/location/qgeoplace.h4
-rw-r--r--src/location/qgeoplace_p.h2
-rw-r--r--src/plugins/places/nokia/qplacecategoriesreplyimpl.cpp2
-rw-r--r--src/plugins/places/nokia/qplacecategoriesrepository.cpp13
-rw-r--r--src/plugins/places/nokia/qplacedetailsreplyimpl.cpp2
-rw-r--r--src/plugins/places/nokia/qplacejsoncategoriesparser.cpp1
-rw-r--r--src/plugins/places/nokia/qplacejsondetailsparser.cpp9
-rw-r--r--src/plugins/places/nokia/qplacejsonsearchparser.cpp11
-rw-r--r--src/plugins/places/nokia/qplacemanagerengineimpl.cpp6
-rw-r--r--src/plugins/places/nokia/qplacemediareplyimpl.cpp2
-rw-r--r--src/plugins/places/nokia/qplaceratingreplyimpl.cpp2
-rw-r--r--src/plugins/places/nokia/qplacerecommendationreplyimpl.cpp2
-rw-r--r--src/plugins/places/nokia/qplacerestmanager.cpp7
-rw-r--r--src/plugins/places/nokia/qplacerestmanager.h1
-rw-r--r--src/plugins/places/nokia/qplacerestreply.h2
-rw-r--r--src/plugins/places/nokia/qplacereviewreplyimpl.cpp2
-rw-r--r--src/plugins/places/nokia/qplacesearchreplyimpl.cpp2
-rw-r--r--src/plugins/places/nokia/qplacetextpredictionreplyimpl.cpp12
-rw-r--r--src/plugins/places/nokia/qplacetextpredictionreplyimpl.h6
50 files changed, 275 insertions, 105 deletions
diff --git a/src/imports/location/declarativeplaces/qdeclarativebusinessinformation.cpp b/src/imports/location/declarativeplaces/qdeclarativebusinessinformation.cpp
index bb501f2d..bf0c7701 100644
--- a/src/imports/location/declarativeplaces/qdeclarativebusinessinformation.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativebusinessinformation.cpp
@@ -64,8 +64,23 @@ void QDeclarativeBusinessInformation::setBusinessInformation(const QPlaceBusines
}
}
-QPlaceBusinessInformation QDeclarativeBusinessInformation::businessInformation() const
+QPlaceBusinessInformation QDeclarativeBusinessInformation::businessInformation()
{
+ QList<QPlaceBusinessFeature> featureList;
+ foreach (QDeclarativeBusinessFeature *value, m_features) {
+ featureList.append(value->businessFeature());
+ }
+ m_src.setFeatures(featureList);
+ QList<QPlaceWeekdayHours> openingList;
+ foreach (QDeclarativeWeekdayHours *value, m_openingHours) {
+ openingList.append(value->weekdayHours());
+ }
+ m_src.setOpeningHours(openingList);
+ QList<QPlacePeriod> annualClosingsList;
+ foreach (QDeclarativePeriod *value, m_annualClosings) {
+ annualClosingsList.append(value->period());
+ }
+ m_src.setAnnualClosings(annualClosingsList);
return m_src;
}
@@ -147,6 +162,9 @@ QStringList QDeclarativeBusinessInformation::paymentMethods() const
\qmlproperty QDeclarativeListProperty<QDeclarativeBusinessFeature> BusinessInformation::features
This property holds business featyres list.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativeBusinessFeature> QDeclarativeBusinessInformation::features()
{
@@ -210,6 +228,9 @@ void QDeclarativeBusinessInformation::synchronizeFeatures()
\qmlproperty QDeclarativeListProperty<QDeclarativeWeekdayHours> BusinessInformation::openingHours
This property opening hours list.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativeWeekdayHours> QDeclarativeBusinessInformation::openingHours()
{
@@ -273,6 +294,9 @@ void QDeclarativeBusinessInformation::synchronizeOpeningHours()
\qmlproperty QDeclarativeListProperty<QDeclarativePeriod> BusinessInformation::annualClosings
This property annual closings list.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativePeriod> QDeclarativeBusinessInformation::annualClosings()
{
diff --git a/src/imports/location/declarativeplaces/qdeclarativebusinessinformation_p.h b/src/imports/location/declarativeplaces/qdeclarativebusinessinformation_p.h
index eacff759..abb73857 100644
--- a/src/imports/location/declarativeplaces/qdeclarativebusinessinformation_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativebusinessinformation_p.h
@@ -28,7 +28,7 @@ public:
QObject* parent = 0);
~QDeclarativeBusinessInformation();
- QPlaceBusinessInformation businessInformation() const;
+ QPlaceBusinessInformation businessInformation();
void setBusinessInformation(const QPlaceBusinessInformation &src);
QVariantHash additionalData() const;
diff --git a/src/imports/location/declarativeplaces/qdeclarativecategory.cpp b/src/imports/location/declarativeplaces/qdeclarativecategory.cpp
index 6dcbcc1f..5f5b6e7d 100644
--- a/src/imports/location/declarativeplaces/qdeclarativecategory.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativecategory.cpp
@@ -45,8 +45,14 @@ void QDeclarativeCategory::setCategory(const QPlaceCategory &category)
}
}
-QPlaceCategory QDeclarativeCategory::category() const
+QPlaceCategory QDeclarativeCategory::category()
{
+ QList<QPlaceAlternativeValue> list;
+ foreach (QDeclarativeAlternativeValue *value, m_alternativeValues) {
+ list.append(value->valueObject());
+ }
+ m_category.setAlternativeNames(list);
+
return m_category;
}
@@ -111,6 +117,8 @@ QString QDeclarativeCategory::name() const
\qmlproperty QVariantHash Address::alternativeAttributes
This property alternative values for label property.
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativeAlternativeValue> QDeclarativeCategory::alternativeNames()
{
diff --git a/src/imports/location/declarativeplaces/qdeclarativecategory_p.h b/src/imports/location/declarativeplaces/qdeclarativecategory_p.h
index d0b9a516..a8fee94e 100644
--- a/src/imports/location/declarativeplaces/qdeclarativecategory_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativecategory_p.h
@@ -23,7 +23,7 @@ public:
explicit QDeclarativeCategory(const QPlaceCategory &category, QObject* parent = 0);
~QDeclarativeCategory();
- QPlaceCategory category() const;
+ QPlaceCategory category();
void setCategory(const QPlaceCategory &category);
QDeclarativeListProperty<QDeclarativeAlternativeValue> alternativeNames();
diff --git a/src/imports/location/declarativeplaces/qdeclarativedescription.cpp b/src/imports/location/declarativeplaces/qdeclarativedescription.cpp
index 115dbb61..22cd3b99 100644
--- a/src/imports/location/declarativeplaces/qdeclarativedescription.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativedescription.cpp
@@ -57,8 +57,9 @@ void QDeclarativeDescription::setDescription(const QPlaceDescription &src)
}
}
-QPlaceDescription QDeclarativeDescription::description() const
+QPlaceDescription QDeclarativeDescription::description()
{
+ m_src.setSupplier(m_declarativeSupplier.supplier());
return m_src;
}
@@ -161,6 +162,9 @@ QString QDeclarativeDescription::sourceUrl() const
\qmlproperty string Description::supplier
This property holds supplier info.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
void QDeclarativeDescription::setSupplier(QDeclarativeSupplier *src)
diff --git a/src/imports/location/declarativeplaces/qdeclarativedescription_p.h b/src/imports/location/declarativeplaces/qdeclarativedescription_p.h
index 2c50204a..4d173ef8 100644
--- a/src/imports/location/declarativeplaces/qdeclarativedescription_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativedescription_p.h
@@ -24,7 +24,7 @@ public:
explicit QDeclarativeDescription(const QPlaceDescription &src, QObject* parent = 0);
~QDeclarativeDescription();
- QPlaceDescription description() const;
+ QPlaceDescription description();
void setDescription(const QPlaceDescription &src);
QString content() const;
diff --git a/src/imports/location/declarativeplaces/qdeclarativemediaobject.cpp b/src/imports/location/declarativeplaces/qdeclarativemediaobject.cpp
index 90841957..5e11d020 100644
--- a/src/imports/location/declarativeplaces/qdeclarativemediaobject.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativemediaobject.cpp
@@ -57,8 +57,9 @@ void QDeclarativeMediaObject::setMediaObject(const QPlaceMediaObject &src)
}
}
-QPlaceMediaObject QDeclarativeMediaObject::mediaObject() const
+QPlaceMediaObject QDeclarativeMediaObject::mediaObject()
{
+ m_src.setSupplier(m_declarativeSupplier.supplier());
return m_src;
}
@@ -161,8 +162,10 @@ QString QDeclarativeMediaObject::id() const
\qmlproperty string MediaObject::supplier
This property holds supplier info.
-*/
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
+*/
void QDeclarativeMediaObject::setSupplier(QDeclarativeSupplier *src)
{
if (m_declarativeSupplier.supplier() != src->supplier()) {
diff --git a/src/imports/location/declarativeplaces/qdeclarativemediaobject_p.h b/src/imports/location/declarativeplaces/qdeclarativemediaobject_p.h
index 6455b523..62ab415e 100644
--- a/src/imports/location/declarativeplaces/qdeclarativemediaobject_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativemediaobject_p.h
@@ -24,7 +24,7 @@ public:
explicit QDeclarativeMediaObject(const QPlaceMediaObject &src, QObject* parent = 0);
~QDeclarativeMediaObject();
- QPlaceMediaObject mediaObject() const;
+ QPlaceMediaObject mediaObject();
void setMediaObject(const QPlaceMediaObject &src);
QString url() const;
diff --git a/src/imports/location/declarativeplaces/qdeclarativemediapaginationlist.cpp b/src/imports/location/declarativeplaces/qdeclarativemediapaginationlist.cpp
index 11505b35..d2321b12 100644
--- a/src/imports/location/declarativeplaces/qdeclarativemediapaginationlist.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativemediapaginationlist.cpp
@@ -54,6 +54,11 @@ void QDeclarativeMediaPaginationList::setPaginationList(const QPlacePaginationLi
QPlacePaginationList<QPlaceMediaObject> QDeclarativeMediaPaginationList::paginationList()
{
+ QList<QPlaceMediaObject> list;
+ foreach (QDeclarativeMediaObject *value, m_objects) {
+ list.append(value->mediaObject());
+ }
+ m_src.setData(list);
return m_src;
}
@@ -102,6 +107,9 @@ int QDeclarativeMediaPaginationList::stop()
\qmlproperty QDeclarativeListProperty<QDeclarativeMediaObject> MediaPaginationList::data
This property contains of list of items.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativeMediaObject> QDeclarativeMediaPaginationList::data()
{
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
index de0c5097..4f5c0084 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
@@ -120,8 +120,43 @@ void QDeclarativePlace::setPlace(const QGeoPlace &src)
}
}
-QGeoPlace QDeclarativePlace::place() const
-{
+QGeoPlace QDeclarativePlace::place()
+{
+ QList<QPlaceAlternativeValue> list;
+ foreach (QDeclarativeAlternativeValue *value, m_alternativeValues) {
+ list.append(value->valueObject());
+ }
+ m_src.setAlternativeNames(list);
+ QList<QPlaceCategory> categories;
+ foreach (QDeclarativeCategory *value, m_categories) {
+ categories.append(value->category());
+ }
+ m_src.setCategories(categories);
+ QList<QPlaceContact> contacts;
+ foreach (QDeclarativeContact *value, m_contacts) {
+ contacts.append(value->contact());
+ }
+ m_src.setContacts(contacts);
+ QList<QPlaceDescription> descriptions;
+ foreach (QDeclarativeDescription *value, m_descriptions) {
+ descriptions.append(value->description());
+ }
+ m_src.setDescriptions(descriptions);
+ m_src.setLocation(m_location.location());
+ QList<QGeoLocation> alternativeLocations;
+ foreach (QDeclarativeGeoLocation *value, m_alternativeLocations) {
+ alternativeLocations.append(value->location());
+ }
+ m_src.setAlternativeLocations(alternativeLocations);
+ m_src.setRating(m_rating.rating());
+ QList<QPlaceSupplier> suppliers;
+ foreach (QDeclarativeSupplier *value, m_suppliers) {
+ suppliers.append(value->supplier());
+ }
+ m_src.setSuppliers(suppliers);
+ m_src.setMedia(m_mediaList.paginationList());
+ m_src.setReviews(m_reviewList.paginationList());
+ m_src.setBusinessInformation(m_businessInformation.businessInformation());
return m_src;
}
@@ -148,6 +183,9 @@ QVariantHash QDeclarativePlace::additionalData() const
\qmlproperty string Place::location
This property holds location of the place.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
void QDeclarativePlace::setLocation(QDeclarativeGeoLocation *location)
{
@@ -167,6 +205,9 @@ QDeclarativeGeoLocation *QDeclarativePlace::location()
\qmlproperty Rating Place::rating
This property holds rating of the place.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
void QDeclarativePlace::setRating(QDeclarativeRating *obj)
{
@@ -186,6 +227,9 @@ QDeclarativeRating *QDeclarativePlace::rating()
\qmlproperty BusinessInformation Place::businessInformation
This property holds business information of the place.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
void QDeclarativePlace::setBusinessInformation(QDeclarativeBusinessInformation *obj)
{
@@ -256,11 +300,11 @@ QString QDeclarativePlace::shortDescription() const
}
/*!
- \qmlproperty double Place::placeScore
+ \qmlproperty qreal Place::placeScore
This property holds place score.
*/
-void QDeclarativePlace::setPlaceScore(const double &placeScore)
+void QDeclarativePlace::setPlaceScore(const qreal &placeScore)
{
if (m_src.placeScore() != placeScore) {
m_src.setPlaceScore(placeScore);
@@ -268,7 +312,7 @@ void QDeclarativePlace::setPlaceScore(const double &placeScore)
}
}
-double QDeclarativePlace::placeScore() const
+qreal QDeclarativePlace::placeScore() const
{
return m_src.placeScore();
}
@@ -295,6 +339,9 @@ int QDeclarativePlace::mediaCount() const
\qmlproperty string Place::media
This property holds media list of the place.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
void QDeclarativePlace::setMedia(QDeclarativeMediaPaginationList *obj)
{
@@ -370,6 +417,9 @@ QStringList QDeclarativePlace::feeds() const
\qmlproperty int Place::reviewCount
This property holds number of all reviews.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
void QDeclarativePlace::setReviewCount(const int &reviewCount)
{
@@ -407,6 +457,9 @@ QDeclarativeReviewPaginationList *QDeclarativePlace::reviews()
\qmlproperty QDeclarativeListProperty<QDeclarativeAlternativeValue> Place::alternativeNames
This property holds alternative values for name property.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativeAlternativeValue> QDeclarativePlace::alternativeNames()
{
@@ -470,6 +523,9 @@ void QDeclarativePlace::synchronizeAlternativeValues()
\qmlproperty QDeclarativeListProperty<QDeclarativeCategory> Place::categories
This property categories list.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativeCategory> QDeclarativePlace::categories()
{
@@ -533,6 +589,9 @@ void QDeclarativePlace::synchronizeCategories()
\qmlproperty QDeclarativeListProperty<QDeclarativeContact> Place::contacts
This property contacts list.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativeContact> QDeclarativePlace::contacts()
{
@@ -596,6 +655,9 @@ void QDeclarativePlace::synchronizeContacts()
\qmlproperty QDeclarativeListProperty<QDeclarativeDescription> Place::descriptions
This property descriptions list.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativeDescription> QDeclarativePlace::descriptions()
{
@@ -659,6 +721,9 @@ void QDeclarativePlace::synchronizeDescriptions()
\qmlproperty QDeclarativeListProperty<QDeclarativeGeoLocation> Place::alternativeLocations
This property alternative locations list.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativeGeoLocation> QDeclarativePlace::alternativeLocations()
{
@@ -722,6 +787,9 @@ void QDeclarativePlace::synchronizeAlternativeLocations()
\qmlproperty QDeclarativeListProperty<QDeclarativeSupplier> Place::suppliers
This property suppliers list.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativeSupplier> QDeclarativePlace::suppliers()
{
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace_p.h b/src/imports/location/declarativeplaces/qdeclarativeplace_p.h
index 9f3b5492..c4fd0177 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplace_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativeplace_p.h
@@ -23,7 +23,7 @@ class QDeclarativePlace : public QObject
Q_PROPERTY(QVariantHash additionalData READ additionalData WRITE setAdditionalData NOTIFY additionalDataChanged);
Q_PROPERTY(QDeclarativeListProperty<QDeclarativeAlternativeValue> alternativeNames READ alternativeNames NOTIFY alternativeNamesChanged)
- Q_PROPERTY(double placeScore READ placeScore WRITE setPlaceScore NOTIFY placeScoreChanged);
+ Q_PROPERTY(qreal placeScore READ placeScore WRITE setPlaceScore NOTIFY placeScoreChanged);
Q_PROPERTY(QDeclarativeListProperty<QDeclarativeCategory> categories READ categories NOTIFY categoriesChanged)
Q_PROPERTY(QDeclarativeListProperty<QDeclarativeContact> contacts READ contacts NOTIFY contactsChanged)
Q_PROPERTY(QDeclarativeListProperty<QDeclarativeDescription> descriptions READ descriptions NOTIFY descriptionsChanged)
@@ -48,7 +48,7 @@ public:
explicit QDeclarativePlace(const QGeoPlace &src, QObject* parent = 0);
~QDeclarativePlace();
- QGeoPlace place() const;
+ QGeoPlace place();
void setPlace(const QGeoPlace &src);
QVariantHash additionalData() const;
@@ -59,8 +59,8 @@ public:
static int alternativeValue_count(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop);
static QDeclarativeAlternativeValue* alternativeValue_at(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop, int index);
static void alternativeValue_clear(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop);
- double placeScore() const;
- void setPlaceScore(const double &data);
+ qreal placeScore() const;
+ void setPlaceScore(const qreal &data);
QDeclarativeListProperty<QDeclarativeCategory> categories();
static void category_append(QDeclarativeListProperty<QDeclarativeCategory> *prop,
QDeclarativeCategory* value);
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplacemanager.cpp b/src/imports/location/declarativeplaces/qdeclarativeplacemanager.cpp
index 482064e3..1d6a99b3 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplacemanager.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativeplacemanager.cpp
@@ -36,6 +36,8 @@ QDeclarativePlaceManager::QDeclarativePlaceManager(QObject *parent) :
m_manager(NULL),
m_response(NULL)
{
+ m_manager = new QPlaceManager(this);
+ m_manager->initializeCategories();
}
QDeclarativePlaceManager::~QDeclarativePlaceManager()
@@ -172,7 +174,7 @@ void QDeclarativePlaceManager::cancelRequest()
void QDeclarativePlaceManager::replyFinished()
{
- if (!m_response) {
+ if (!m_response || m_response->error()) {
return;
}
if (m_response->type() == QPlaceReply::PlaceDetailsReply) {
diff --git a/src/imports/location/declarativeplaces/qdeclarativerating.cpp b/src/imports/location/declarativeplaces/qdeclarativerating.cpp
index 685ca29a..1095ccbd 100644
--- a/src/imports/location/declarativeplaces/qdeclarativerating.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativerating.cpp
@@ -40,12 +40,12 @@ QPlaceRating QDeclarativeRating::rating() const
}
/*!
- \qmlproperty double Rating::value
+ \qmlproperty qreal Rating::value
This property holds the value of rating
*/
-void QDeclarativeRating::setValue(const double &value)
+void QDeclarativeRating::setValue(const qreal &value)
{
if (m_rating.value() != value) {
m_rating.setValue(value);
@@ -53,7 +53,7 @@ void QDeclarativeRating::setValue(const double &value)
}
}
-double QDeclarativeRating::value() const
+qreal QDeclarativeRating::value() const
{
return m_rating.value();
}
diff --git a/src/imports/location/declarativeplaces/qdeclarativerating_p.h b/src/imports/location/declarativeplaces/qdeclarativerating_p.h
index fe6f739a..ac2a6554 100644
--- a/src/imports/location/declarativeplaces/qdeclarativerating_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativerating_p.h
@@ -12,7 +12,7 @@ class QDeclarativeRating : public QObject
{
Q_OBJECT
- Q_PROPERTY(double value READ value WRITE setValue NOTIFY valueChanged)
+ Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged)
Q_PROPERTY(int count READ count WRITE setCount NOTIFY countChanged)
public:
@@ -23,8 +23,8 @@ public:
QPlaceRating rating() const;
void setRating(const QPlaceRating &src);
- double value() const;
- void setValue(const double &data);
+ qreal value() const;
+ void setValue(const qreal &data);
int count() const;
void setCount(const int &data);
diff --git a/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp
index 2fab992f..712058d1 100644
--- a/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp
@@ -66,6 +66,9 @@ QDeclarativeRecommendationModel::QDeclarativeRecommendationModel(QObject *parent
roleNames = QAbstractItemModel::roleNames();
roleNames.insert(SearchResultRole, "searchResult");
setRoleNames(roleNames);
+
+ m_manager = new QPlaceManager(this);
+ m_manager->initializeCategories();
}
QDeclarativeRecommendationModel::~QDeclarativeRecommendationModel()
diff --git a/src/imports/location/declarativeplaces/qdeclarativereview.cpp b/src/imports/location/declarativeplaces/qdeclarativereview.cpp
index e2a67dfe..3ab570e7 100644
--- a/src/imports/location/declarativeplaces/qdeclarativereview.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativereview.cpp
@@ -78,8 +78,9 @@ void QDeclarativeReview::setReview(const QPlaceReview &src)
}
}
-QPlaceReview QDeclarativeReview::review() const
+QPlaceReview QDeclarativeReview::review()
{
+ m_src.setSupplier(m_declarativeSupplier.supplier());
return m_src;
}
@@ -250,11 +251,11 @@ QStringList QDeclarativeReview::mediaIds() const
}
/*!
- \qmlproperty string Review::rating
+ \qmlproperty qreal Review::rating
This property holds rating value.
*/
-void QDeclarativeReview::setRating(const double &rating)
+void QDeclarativeReview::setRating(const qreal &rating)
{
if (m_src.rating() != rating) {
m_src.setRating(rating);
@@ -262,7 +263,7 @@ void QDeclarativeReview::setRating(const double &rating)
}
}
-double QDeclarativeReview::rating() const
+qreal QDeclarativeReview::rating() const
{
return m_src.rating();
}
@@ -307,6 +308,9 @@ int QDeclarativeReview::unhelpfulVotings() const
\qmlproperty string Review::supplier
This property holds supplier info.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
void QDeclarativeReview::setSupplier(QDeclarativeSupplier *src)
{
diff --git a/src/imports/location/declarativeplaces/qdeclarativereview_p.h b/src/imports/location/declarativeplaces/qdeclarativereview_p.h
index 11f9721d..c77b9ff8 100644
--- a/src/imports/location/declarativeplaces/qdeclarativereview_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativereview_p.h
@@ -23,7 +23,7 @@ class QDeclarativeReview : public QObject
Q_PROPERTY(QString originatorUrl READ originatorUrl WRITE setOriginatorUrl NOTIFY originatorUrlChanged);
Q_PROPERTY(int helpfulVotings READ helpfulVotings WRITE setHelpfulVotings NOTIFY helpfulVotingsChanged);
Q_PROPERTY(int unhelpfulVotings READ unhelpfulVotings WRITE setUnhelpfulVotings NOTIFY unhelpfulVotingsChanged);
- Q_PROPERTY(double rating READ rating WRITE setRating NOTIFY ratingChanged);
+ Q_PROPERTY(qreal rating READ rating WRITE setRating NOTIFY ratingChanged);
Q_PROPERTY(QStringList mediaIds READ mediaIds WRITE setMediaIds NOTIFY mediaIdsChanged);
public:
@@ -31,7 +31,7 @@ public:
explicit QDeclarativeReview(const QPlaceReview &src, QObject* parent = 0);
~QDeclarativeReview();
- QPlaceReview review() const;
+ QPlaceReview review();
void setReview(const QPlaceReview &src);
QString date() const;
@@ -46,8 +46,8 @@ public:
void setMediaIds(const QStringList &data);
int unhelpfulVotings() const;
void setUnhelpfulVotings(const int &data);
- double rating() const;
- void setRating(const double &data);
+ qreal rating() const;
+ void setRating(const qreal &data);
QString reviewId() const;
void setReviewId(const QString &data);
QString title() const;
diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchresult.cpp b/src/imports/location/declarativeplaces/qdeclarativesearchresult.cpp
index c7cfd4dd..44f0d97f 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesearchresult.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativesearchresult.cpp
@@ -62,8 +62,9 @@ void QDeclarativeSearchResult::setSearchResult(const QPlaceSearchResult &src)
}
}
-QPlaceSearchResult QDeclarativeSearchResult::searchResult() const
+QPlaceSearchResult QDeclarativeSearchResult::searchResult()
{
+ m_place.setPlace(m_place.place());
return m_src;
}
@@ -197,6 +198,9 @@ QString QDeclarativeSearchResult::didYouMeanSuggestion() const
\qmlproperty Place SearchResult::place
This property holds place result.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
void QDeclarativeSearchResult::setPlace(QDeclarativePlace *place)
{
diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchresult_p.h b/src/imports/location/declarativeplaces/qdeclarativesearchresult_p.h
index 94c95823..e740e0e6 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesearchresult_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativesearchresult_p.h
@@ -41,7 +41,7 @@ public:
explicit QDeclarativeSearchResult(const QPlaceSearchResult &src, QObject* parent = 0);
~QDeclarativeSearchResult();
- QPlaceSearchResult searchResult() const;
+ QPlaceSearchResult searchResult();
void setSearchResult(const QPlaceSearchResult &src);
qreal relevance() const;
diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
index d383f720..22d82758 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
@@ -39,18 +39,17 @@ QT_USE_NAMESPACE
}
radius:5000
}
-
start: 0
limit: 15
}
...
- resultModel.executeQuery()
+ searchModel.executeQuery()
...
ListView {
id: suggestionList
- model: suggestionModel
+ model: searchModel
delegate: Text {
text: 'Name: ' + searchResult.place.name }
}
@@ -68,6 +67,9 @@ QDeclarativeSearchResultModel::QDeclarativeSearchResultModel(QObject *parent) :
roleNames = QAbstractItemModel::roleNames();
roleNames.insert(SearchResultRole, "searchResult");
setRoleNames(roleNames);
+
+ m_manager = new QPlaceManager(this);
+ m_manager->initializeCategories();
}
QDeclarativeSearchResultModel::~QDeclarativeSearchResultModel()
@@ -198,6 +200,9 @@ void QDeclarativeSearchResultModel::setSearchTerm(const QString &searchTerm)
\qmlproperty Category SearchResultModel::searchCategory
This element holds search category. Search Category is used instead of search term.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeCategory *QDeclarativeSearchResultModel::searchCategory()
{
@@ -307,6 +312,7 @@ void QDeclarativeSearchResultModel::executeQuery()
m_manager = new QPlaceManager(this);
}
cancelPreviousRequest();
+
m_queryParameters.setSearchArea(m_searchArea->area());
connectNewResponse(m_manager->searchForPlaces(m_queryParameters, QPlaceManager::PublicScope));
}
@@ -328,6 +334,7 @@ void QDeclarativeSearchResultModel::clearCategories()
{
if (m_queryParameters.categories().count()) {
m_queryParameters.setCategory(QPlaceCategory());
+ m_category.setCategory(QPlaceCategory());
emit searchCategoryChanged();
}
}
diff --git a/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel.cpp
index 56056616..9539cb84 100644
--- a/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativetextpredictionmodel.cpp
@@ -64,6 +64,9 @@ QDeclarativeTextPredictionModel::QDeclarativeTextPredictionModel(QObject *parent
roleNames = QAbstractItemModel::roleNames();
roleNames.insert(TextPredictionRole, "textPrediction");
setRoleNames(roleNames);
+
+ m_manager = new QPlaceManager(this);
+ m_manager->initializeCategories();
}
QDeclarativeTextPredictionModel::~QDeclarativeTextPredictionModel()
@@ -214,6 +217,7 @@ void QDeclarativeTextPredictionModel::executeQuery()
m_manager = new QPlaceManager(this);
}
cancelPreviousRequest();
+
m_queryParameters.setSearchArea(m_searchArea->area());
connectNewResponse(m_manager->textPredictions(m_queryParameters));
}
diff --git a/src/imports/location/declarativeplaces/qdeclarativeweekdayhours.cpp b/src/imports/location/declarativeplaces/qdeclarativeweekdayhours.cpp
index ab674d5d..9c9ec704 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeweekdayhours.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativeweekdayhours.cpp
@@ -37,8 +37,9 @@ void QDeclarativeWeekdayHours::setWeekdayHours(const QPlaceWeekdayHours &weekday
}
}
-QPlaceWeekdayHours QDeclarativeWeekdayHours::weekdayHours() const
+QPlaceWeekdayHours QDeclarativeWeekdayHours::weekdayHours()
{
+ m_weekdayHours.setPeriod(m_period.period());
return m_weekdayHours;
}
@@ -46,6 +47,9 @@ QPlaceWeekdayHours QDeclarativeWeekdayHours::weekdayHours() const
\qmlproperty Qt::DayOfWeek WeekdayHours::weekday
This property holds the day of the week.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
void QDeclarativeWeekdayHours::setWeekday(const Qt::DayOfWeek &weekday)
diff --git a/src/imports/location/declarativeplaces/qdeclarativeweekdayhours_p.h b/src/imports/location/declarativeplaces/qdeclarativeweekdayhours_p.h
index 630d1cb1..b3b1d4af 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeweekdayhours_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativeweekdayhours_p.h
@@ -21,7 +21,7 @@ public:
explicit QDeclarativeWeekdayHours(const QPlaceWeekdayHours &weekdayHours, QObject* parent = 0);
~QDeclarativeWeekdayHours();
- QPlaceWeekdayHours weekdayHours() const;
+ QPlaceWeekdayHours weekdayHours();
void setWeekdayHours(const QPlaceWeekdayHours &weekdayHours);
QDeclarativePeriod *period();
diff --git a/src/imports/location/qdeclarativegeolocation.cpp b/src/imports/location/qdeclarativegeolocation.cpp
index 04dcd20d..c3a40067 100644
--- a/src/imports/location/qdeclarativegeolocation.cpp
+++ b/src/imports/location/qdeclarativegeolocation.cpp
@@ -74,8 +74,21 @@ void QDeclarativeGeoLocation::setLocation(const QGeoLocation &src)
}
}
-QGeoLocation QDeclarativeGeoLocation::location() const
+QGeoLocation QDeclarativeGeoLocation::location()
{
+ QList<QPlaceAlternativeValue> list;
+ foreach (QDeclarativeAlternativeValue *value, m_alternativeValues) {
+ list.append(value->valueObject());
+ }
+ m_src.setAlternativeLabels(list);
+ QList<QGeoCoordinate> navigationList;
+ foreach (QDeclarativeCoordinate *value, m_navigationPositions) {
+ navigationList.append(value->coordinate());
+ }
+ m_src.setNavigationPositions(navigationList);
+ m_src.setAddress(m_address.address());
+ m_src.setCoordinate(m_coordinate.coordinate());
+ m_src.setViewport(m_boundingBox.box());
return m_src;
}
@@ -121,6 +134,9 @@ QDeclarativeGeoAddress *QDeclarativeGeoLocation::address()
\qmlproperty string Location::coordinate
This property holds display coordinates of the location.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
void QDeclarativeGeoLocation::setCoordinate(QDeclarativeCoordinate *coordinate)
{
@@ -173,11 +189,11 @@ QString QDeclarativeGeoLocation::locationId() const
}
/*!
- \qmlproperty string Location::locationScore
+ \qmlproperty qreal Location::locationScore
This property holds location score.
*/
-void QDeclarativeGeoLocation::setLocationScore(const int &locationScore)
+void QDeclarativeGeoLocation::setLocationScore(const qreal &locationScore)
{
if (m_src.locationScore() != locationScore) {
m_src.setLocationScore(locationScore);
@@ -185,15 +201,18 @@ void QDeclarativeGeoLocation::setLocationScore(const int &locationScore)
}
}
-int QDeclarativeGeoLocation::locationScore() const
+qreal QDeclarativeGeoLocation::locationScore() const
{
return m_src.locationScore();
}
/*!
- \qmlproperty string Location::viewport
+ \qmlproperty BoundingBox Location::viewport
This property holds bouding box of area on map ocupied by location.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
void QDeclarativeGeoLocation::setViewport(QDeclarativeGeoBoundingBox *viewport)
{
@@ -213,6 +232,9 @@ QDeclarativeGeoBoundingBox *QDeclarativeGeoLocation::viewport()
\qmlproperty QDeclarativeListProperty<QDeclarativeAlternativeValue> Location::alternativeLabels
This property alternative values for label property.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativeAlternativeValue> QDeclarativeGeoLocation::alternativeLabels()
{
@@ -266,6 +288,9 @@ void QDeclarativeGeoLocation::alternativeValue_clear(QDeclarativeListProperty<QD
\qmlproperty QDeclarativeListProperty<QDeclarativeCoordinate> Location::navigationPositions
This property navigation coordinates for location.
+
+ Note: this property's changed() signal is currently emitted only if the
+ whole element changes, not if only the contents of the element change.
*/
QDeclarativeListProperty<QDeclarativeCoordinate> QDeclarativeGeoLocation::navigationPositions()
{
diff --git a/src/imports/location/qdeclarativegeolocation_p.h b/src/imports/location/qdeclarativegeolocation_p.h
index 6e103b11..4c4dda8b 100644
--- a/src/imports/location/qdeclarativegeolocation_p.h
+++ b/src/imports/location/qdeclarativegeolocation_p.h
@@ -22,7 +22,7 @@ class QDeclarativeGeoLocation : public QObject
Q_PROPERTY(QDeclarativeListProperty<QDeclarativeCoordinate> navigationPositions READ navigationPositions NOTIFY navigationPositionsChanged)
Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged);
Q_PROPERTY(QString locationId READ locationId WRITE setLocationId NOTIFY locationIdChanged);
- Q_PROPERTY(int locationScore READ locationScore WRITE setLocationScore NOTIFY locationScoreChanged);
+ Q_PROPERTY(qreal locationScore READ locationScore WRITE setLocationScore NOTIFY locationScoreChanged);
Q_PROPERTY(QDeclarativeGeoBoundingBox* viewport READ viewport WRITE setViewport NOTIFY viewportChanged);
public:
@@ -30,7 +30,7 @@ public:
explicit QDeclarativeGeoLocation(const QGeoLocation &src, QObject* parent = 0);
~QDeclarativeGeoLocation();
- QGeoLocation location() const;
+ QGeoLocation location() ;
void setLocation(const QGeoLocation &src);
QVariantHash additionalData() const;
@@ -55,8 +55,8 @@ public:
void setLabel(const QString &label);
QString locationId() const;
void setLocationId(const QString &locationId);
- int locationScore() const;
- void setLocationScore(const int &score);
+ qreal locationScore() const;
+ void setLocationScore(const qreal &score);
QDeclarativeGeoBoundingBox *viewport();
void setViewport(QDeclarativeGeoBoundingBox *boundingBox);
diff --git a/src/location/places/qplacerating.cpp b/src/location/places/qplacerating.cpp
index a708b653..efdf54f2 100644
--- a/src/location/places/qplacerating.cpp
+++ b/src/location/places/qplacerating.cpp
@@ -118,7 +118,7 @@ bool QPlaceRating::operator==(const QPlaceRating &other) const
/*!
Returns value.
*/
-double QPlaceRating::value() const
+qreal QPlaceRating::value() const
{
return d->value;
}
@@ -126,7 +126,7 @@ double QPlaceRating::value() const
/*!
Sets the \a value.
*/
-void QPlaceRating::setValue(const double &value)
+void QPlaceRating::setValue(const qreal &value)
{
d->value = value;
}
diff --git a/src/location/places/qplacerating.h b/src/location/places/qplacerating.h
index 618b6da1..a1e76e41 100644
--- a/src/location/places/qplacerating.h
+++ b/src/location/places/qplacerating.h
@@ -64,10 +64,10 @@ public:
return !(other == *this);
}
- double value() const;
- void setValue(const double &data);
+ qreal value() const;
+ void setValue(const qreal &value);
int count() const;
- void setCount(const int &dcount);
+ void setCount(const int &count);
private:
QSharedDataPointer<QPlaceRatingPrivate> d;
diff --git a/src/location/places/qplacereview.cpp b/src/location/places/qplacereview.cpp
index 8deef663..fb372d21 100644
--- a/src/location/places/qplacereview.cpp
+++ b/src/location/places/qplacereview.cpp
@@ -244,7 +244,7 @@ void QPlaceReview::setUnhelpfulVotings(const int &votes)
/*!
Returns rating.
*/
-double QPlaceReview::rating() const
+qreal QPlaceReview::rating() const
{
return d->rating;
}
@@ -252,7 +252,7 @@ double QPlaceReview::rating() const
/*!
Sets rating.
*/
-void QPlaceReview::setRating(const double &data)
+void QPlaceReview::setRating(const qreal &data)
{
d->rating = data;
}
diff --git a/src/location/places/qplacereview.h b/src/location/places/qplacereview.h
index 2fc75924..eea4faf6 100644
--- a/src/location/places/qplacereview.h
+++ b/src/location/places/qplacereview.h
@@ -78,8 +78,8 @@ public:
void setMediaIds(const QStringList &data);
int unhelpfulVotings() const;
void setUnhelpfulVotings(const int &votes);
- double rating() const;
- void setRating(const double &data);
+ qreal rating() const;
+ void setRating(const qreal &data);
QString reviewId() const;
void setReviewId(const QString &data);
QPlaceSupplier supplier() const;
diff --git a/src/location/places/qplacereview_p.h b/src/location/places/qplacereview_p.h
index a5e7a8cc..4eb4e1ab 100644
--- a/src/location/places/qplacereview_p.h
+++ b/src/location/places/qplacereview_p.h
@@ -64,7 +64,7 @@ public:
int helpfulVotings;
QStringList mediaIds;
int unhelpfulVotings;
- double rating;
+ qreal rating;
QString reviewId;
QPlaceSupplier supplier;
QString title;
diff --git a/src/location/qgeoplace.cpp b/src/location/qgeoplace.cpp
index 9396ec11..6e6014bb 100644
--- a/src/location/qgeoplace.cpp
+++ b/src/location/qgeoplace.cpp
@@ -273,7 +273,7 @@ void QGeoPlace::setAlternativeNames(const QList<QPlaceAlternativeValue> &alterna
/*!
Returns place score.
*/
-double QGeoPlace::placeScore() const
+qreal QGeoPlace::placeScore() const
{
Q_D(const QGeoPlace);
return d->placeScore;
@@ -282,10 +282,10 @@ double QGeoPlace::placeScore() const
/*!
Sets place score.
*/
-void QGeoPlace::setPlaceScore(const double &data)
+void QGeoPlace::setPlaceScore(const qreal &score)
{
Q_D(QGeoPlace);
- d->placeScore = data;
+ d->placeScore = score;
}
/*!
diff --git a/src/location/qgeoplace.h b/src/location/qgeoplace.h
index f757584f..54a767b6 100644
--- a/src/location/qgeoplace.h
+++ b/src/location/qgeoplace.h
@@ -95,8 +95,8 @@ public:
void setAdditionalData(const QVariantHash &data);
QList<QPlaceAlternativeValue> alternativeNames() const;
void setAlternativeNames(const QList<QPlaceAlternativeValue> &alternativeNames);
- double placeScore() const;
- void setPlaceScore(const double &data);
+ qreal placeScore() const;
+ void setPlaceScore(const qreal &data);
QPlaceBusinessInformation businessInformation() const;
void setBusinessInformation(const QPlaceBusinessInformation &business);
QList<QPlaceCategory> categories() const;
diff --git a/src/location/qgeoplace_p.h b/src/location/qgeoplace_p.h
index a4a906b4..6b18c354 100644
--- a/src/location/qgeoplace_p.h
+++ b/src/location/qgeoplace_p.h
@@ -87,7 +87,7 @@ public:
QVariantHash additionalData;
QList<QPlaceAlternativeValue> alternativeNames;
- double placeScore;
+ qreal placeScore;
QPlaceBusinessInformation businessInfo;
QList<QPlaceCategory> categories;
QList<QPlaceContact> contacts;
diff --git a/src/plugins/places/nokia/qplacecategoriesreplyimpl.cpp b/src/plugins/places/nokia/qplacecategoriesreplyimpl.cpp
index 5431c0a4..e312813e 100644
--- a/src/plugins/places/nokia/qplacecategoriesreplyimpl.cpp
+++ b/src/plugins/places/nokia/qplacecategoriesreplyimpl.cpp
@@ -46,7 +46,7 @@ void QPlaceCategoriesReplyImpl::abort()
void QPlaceCategoriesReplyImpl::restError(QPlaceRestReply::Error errorId)
{
if (errorId == QPlaceRestReply::Canceled) {
- this->setError(CancelError, "ReauestCanceled");
+ this->setError(CancelError, "RequestCanceled");
} else if (errorId == QPlaceRestReply::NetworkError) {
this->setError(CommunicationError, "Network error");
}
diff --git a/src/plugins/places/nokia/qplacecategoriesrepository.cpp b/src/plugins/places/nokia/qplacecategoriesrepository.cpp
index e78ab519..4304f3c0 100644
--- a/src/plugins/places/nokia/qplacecategoriesrepository.cpp
+++ b/src/plugins/places/nokia/qplacecategoriesrepository.cpp
@@ -79,12 +79,13 @@ QPlaceCategoriesRepository::~QPlaceCategoriesRepository()
QPlaceReply *QPlaceCategoriesRepository::initializeCategories()
{
- QPlaceRestReply *restReply = QPlaceRestManager::instance()->sendCategoriesTreeRequest();
- if (restReply) {
- categoriesReply = new QPlaceCategoriesReplyImpl(restReply);
- connect(categoriesReply, SIGNAL(finished()),
- this, SLOT(replyFinished()));
-
+ if (!categoriesReply) {
+ QPlaceRestReply *restReply = QPlaceRestManager::instance()->sendCategoriesTreeRequest();
+ if (restReply) {
+ categoriesReply = new QPlaceCategoriesReplyImpl(restReply);
+ connect(categoriesReply, SIGNAL(finished()),
+ this, SLOT(replyFinished()));
+ }
}
return categoriesReply;
}
diff --git a/src/plugins/places/nokia/qplacedetailsreplyimpl.cpp b/src/plugins/places/nokia/qplacedetailsreplyimpl.cpp
index bee6c577..06a6e228 100644
--- a/src/plugins/places/nokia/qplacedetailsreplyimpl.cpp
+++ b/src/plugins/places/nokia/qplacedetailsreplyimpl.cpp
@@ -89,7 +89,7 @@ void QPlaceDetailsReplyImpl::abort()
void QPlaceDetailsReplyImpl::restError(QPlaceRestReply::Error errorId)
{
if (errorId == QPlaceRestReply::Canceled) {
- this->setError(CancelError, "ReauestCanceled");
+ this->setError(CancelError, "RequestCanceled");
} else if (errorId == QPlaceRestReply::NetworkError) {
this->setError(CommunicationError, "Network error");
}
diff --git a/src/plugins/places/nokia/qplacejsoncategoriesparser.cpp b/src/plugins/places/nokia/qplacejsoncategoriesparser.cpp
index f397c366..18e875a9 100644
--- a/src/plugins/places/nokia/qplacejsoncategoriesparser.cpp
+++ b/src/plugins/places/nokia/qplacejsoncategoriesparser.cpp
@@ -179,7 +179,6 @@ QList<QPlaceCategory> QPlaceJSonCategoriesParser::processGroup(const QScriptValu
}
if (!parentCategory.categoryId().isEmpty()) {
results = processCategories(group);
- results.append(parentCategory);
}
return results;
diff --git a/src/plugins/places/nokia/qplacejsondetailsparser.cpp b/src/plugins/places/nokia/qplacejsondetailsparser.cpp
index 758653e6..05cf3562 100644
--- a/src/plugins/places/nokia/qplacejsondetailsparser.cpp
+++ b/src/plugins/places/nokia/qplacejsondetailsparser.cpp
@@ -215,8 +215,13 @@ QGeoPlace QPlaceJSonDetailsParser::result()
void QPlaceJSonDetailsParser::processJSonData(const QScriptValue &sv)
{
if (sv.isValid()) {
- buildPlace(sv.property(place_place_element), &place);
- emit finished(QPlaceJSonDetailsParser::NoError, QString());
+ QScriptValue placeProperty = sv.property(place_place_element);
+ if (placeProperty.isValid()) {
+ buildPlace(placeProperty, &place);
+ emit finished(NoError, QString());
+ } else {
+ emit finished(ParsingError, QString("JSON data are invalid"));
+ }
} else {
emit finished(ParsingError, QString("JSON data are invalid"));
}
diff --git a/src/plugins/places/nokia/qplacejsonsearchparser.cpp b/src/plugins/places/nokia/qplacejsonsearchparser.cpp
index 307f3325..8e821b03 100644
--- a/src/plugins/places/nokia/qplacejsonsearchparser.cpp
+++ b/src/plugins/places/nokia/qplacejsonsearchparser.cpp
@@ -127,15 +127,20 @@ void QPlaceJSonSearchParser::processJSonData(const QScriptValue &sv)
searchResultsList.clear();
if (sv.isValid()) {
- QScriptValueIterator it(sv.property(search_results_element));
+ QScriptValue results = sv.property(search_results_element);
+ if (results.isValid()) {
+ QScriptValueIterator it(results);
while (it.hasNext()) {
it.next();
// array contains count as last element
- if (it.name() != "length") {
+ if (it.name() != QLatin1String("length")) {
processResultElement(it.value());
}
}
- emit finished(NoError, QString());
+ emit finished(NoError, QString());
+ } else {
+ emit finished(ParsingError, QString("JSON data are invalid"));
+ }
} else {
emit finished(ParsingError, QString("JSON data are invalid"));
}
diff --git a/src/plugins/places/nokia/qplacemanagerengineimpl.cpp b/src/plugins/places/nokia/qplacemanagerengineimpl.cpp
index 5cc08ad0..c4408984 100644
--- a/src/plugins/places/nokia/qplacemanagerengineimpl.cpp
+++ b/src/plugins/places/nokia/qplacemanagerengineimpl.cpp
@@ -147,7 +147,7 @@ QPlaceSearchReply *QPlaceManagerEngineImpl::searchForPlaces(const QPlaceSearchQu
QPlaceSearchQuery newQuery = query;
// search by category
if (newQuery.categories().count()) {
- newQuery.setSearchTerm(query.categories().at(0).categoryId());
+ newQuery.setSearchTerm(query.categories().at(0).name());
}
QPlaceRestReply *restReply = QPlaceRestManager::instance()->sendSearchRequest(newQuery);
@@ -184,10 +184,10 @@ QPlaceSearchReply *QPlaceManagerEngineImpl::recommendations(const QGeoPlace &pla
QPlaceTextPredictionReply *QPlaceManagerEngineImpl::textPredictions(const QPlaceSearchQuery &query)
{
- QPlaceTextPreditionReplyImpl *reply = NULL;
+ QPlaceTextPredictionReplyImpl *reply = NULL;
QPlaceRestReply *restReply = QPlaceRestManager::instance()->sendSuggestionRequest(query);
if (restReply) {
- reply = new QPlaceTextPreditionReplyImpl(restReply, this);
+ reply = new QPlaceTextPredictionReplyImpl(restReply, this);
connect(reply, SIGNAL(processingError(QPlaceReply*,QPlaceReply::Error,QString)),
this, SLOT(processingError(QPlaceReply*,QPlaceReply::Error,QString)));
connect(reply, SIGNAL(processingFinished(QPlaceReply*)),
diff --git a/src/plugins/places/nokia/qplacemediareplyimpl.cpp b/src/plugins/places/nokia/qplacemediareplyimpl.cpp
index e013d472..4a179e39 100644
--- a/src/plugins/places/nokia/qplacemediareplyimpl.cpp
+++ b/src/plugins/places/nokia/qplacemediareplyimpl.cpp
@@ -95,7 +95,7 @@ void QPlaceMediaReplyImpl::setStartNumber(int number)
void QPlaceMediaReplyImpl::restError(QPlaceRestReply::Error errorId)
{
if (errorId == QPlaceRestReply::Canceled) {
- this->setError(CancelError, "ReauestCanceled");
+ this->setError(CancelError, "RequestCanceled");
} else if (errorId == QPlaceRestReply::NetworkError) {
this->setError(CommunicationError, "Network error");
}
diff --git a/src/plugins/places/nokia/qplaceratingreplyimpl.cpp b/src/plugins/places/nokia/qplaceratingreplyimpl.cpp
index b71b6c38..5e479e43 100644
--- a/src/plugins/places/nokia/qplaceratingreplyimpl.cpp
+++ b/src/plugins/places/nokia/qplaceratingreplyimpl.cpp
@@ -88,7 +88,7 @@ void QPlaceRatingReplyImpl::abort()
void QPlaceRatingReplyImpl::restError(QPlaceRestReply::Error errorId)
{
if (errorId == QPlaceRestReply::Canceled) {
- this->setError(CancelError, "ReauestCanceled");
+ this->setError(CancelError, "RequestCanceled");
} else if (errorId == QPlaceRestReply::NetworkError) {
this->setError(CommunicationError, "Network error");
}
diff --git a/src/plugins/places/nokia/qplacerecommendationreplyimpl.cpp b/src/plugins/places/nokia/qplacerecommendationreplyimpl.cpp
index 98bfddab..0873f640 100644
--- a/src/plugins/places/nokia/qplacerecommendationreplyimpl.cpp
+++ b/src/plugins/places/nokia/qplacerecommendationreplyimpl.cpp
@@ -90,7 +90,7 @@ void QPlaceRecommendationReplyImpl::abort()
void QPlaceRecommendationReplyImpl::restError(QPlaceRestReply::Error errorId)
{
if (errorId == QPlaceRestReply::Canceled) {
- this->setError(CancelError, "ReauestCanceled");
+ this->setError(CancelError, "RequestCanceled");
} else if (errorId == QPlaceRestReply::NetworkError) {
this->setError(CommunicationError, "Network error");
}
diff --git a/src/plugins/places/nokia/qplacerestmanager.cpp b/src/plugins/places/nokia/qplacerestmanager.cpp
index d0d4e997..35fd4129 100644
--- a/src/plugins/places/nokia/qplacerestmanager.cpp
+++ b/src/plugins/places/nokia/qplacerestmanager.cpp
@@ -70,7 +70,6 @@ const char *images = "/images";
const char *categoriesTree = "categories/find-places/grouped";
const char *const_query = "&q=";
-const char *const_tag = "&ta=";
const char *const_lat = "&lat=";
const char *const_lon = "&lon=";
const char *const_top = "&vpn=";
@@ -195,12 +194,6 @@ QPlaceRestReply *QPlaceRestManager::sendSearchRequest(const QPlaceSearchQuery &q
+ const_query + query.searchTerm());
}
-QPlaceRestReply *QPlaceRestManager::sendSearchByCategoryRequest(const QPlaceSearchQuery &query)
-{
- return sendGeneralRequest(prepareSearchRequest(query)
- + const_tag + query.searchTerm());
-}
-
QPlaceRestReply *QPlaceRestManager::postRatingRequest(const QString &placeId, const QString &userId, const int &value)
{
QNetworkRequest request;
diff --git a/src/plugins/places/nokia/qplacerestmanager.h b/src/plugins/places/nokia/qplacerestmanager.h
index 72162e35..b86d0473 100644
--- a/src/plugins/places/nokia/qplacerestmanager.h
+++ b/src/plugins/places/nokia/qplacerestmanager.h
@@ -74,7 +74,6 @@ public:
QPlaceRestReply *sendRecommendationRequest(const QPlaceSearchQuery &query, const QString &userId);
QPlaceRestReply *sendCategoriesTreeRequest();
QPlaceRestReply *sendSearchRequest(const QPlaceSearchQuery &query);
- QPlaceRestReply *sendSearchByCategoryRequest(const QPlaceSearchQuery &query);
QPlaceRestReply *sendSuggestionRequest(const QPlaceSearchQuery &query);
QPlaceRestReply *postRatingRequest(const QString &placeId, const QString &userId, const int &value);
diff --git a/src/plugins/places/nokia/qplacerestreply.h b/src/plugins/places/nokia/qplacerestreply.h
index a2ba604a..9429583f 100644
--- a/src/plugins/places/nokia/qplacerestreply.h
+++ b/src/plugins/places/nokia/qplacerestreply.h
@@ -78,7 +78,7 @@ signals:
void finished(const QString &reply);
void error(QPlaceRestReply::Error error);
-private slots:
+public slots:
void replyFinished();
void replyError(QNetworkReply::NetworkError error);
diff --git a/src/plugins/places/nokia/qplacereviewreplyimpl.cpp b/src/plugins/places/nokia/qplacereviewreplyimpl.cpp
index 16588dcc..ffeade55 100644
--- a/src/plugins/places/nokia/qplacereviewreplyimpl.cpp
+++ b/src/plugins/places/nokia/qplacereviewreplyimpl.cpp
@@ -95,7 +95,7 @@ void QPlaceReviewReplyImpl::setStartNumber(int number)
void QPlaceReviewReplyImpl::restError(QPlaceRestReply::Error errorId)
{
if (errorId == QPlaceRestReply::Canceled) {
- this->setError(CancelError, "ReauestCanceled");
+ this->setError(CancelError, "RequestCanceled");
} else if (errorId == QPlaceRestReply::NetworkError) {
this->setError(CommunicationError, "Network error");
}
diff --git a/src/plugins/places/nokia/qplacesearchreplyimpl.cpp b/src/plugins/places/nokia/qplacesearchreplyimpl.cpp
index c0875e5d..43952055 100644
--- a/src/plugins/places/nokia/qplacesearchreplyimpl.cpp
+++ b/src/plugins/places/nokia/qplacesearchreplyimpl.cpp
@@ -90,7 +90,7 @@ void QPlaceSearchReplyImpl::abort()
void QPlaceSearchReplyImpl::restError(QPlaceRestReply::Error errorId)
{
if (errorId == QPlaceRestReply::Canceled) {
- this->setError(CancelError, "ReauestCanceled");
+ this->setError(CancelError, "RequestCanceled");
} else if (errorId == QPlaceRestReply::NetworkError) {
this->setError(CommunicationError, "Network error");
}
diff --git a/src/plugins/places/nokia/qplacetextpredictionreplyimpl.cpp b/src/plugins/places/nokia/qplacetextpredictionreplyimpl.cpp
index 49ce4fd2..d4104701 100644
--- a/src/plugins/places/nokia/qplacetextpredictionreplyimpl.cpp
+++ b/src/plugins/places/nokia/qplacetextpredictionreplyimpl.cpp
@@ -59,7 +59,7 @@ QT_USE_NAMESPACE
/*!
Constructor.
*/
-QPlaceTextPreditionReplyImpl::QPlaceTextPreditionReplyImpl(QPlaceRestReply *reply, QObject *parent) :
+QPlaceTextPredictionReplyImpl::QPlaceTextPredictionReplyImpl(QPlaceRestReply *reply, QObject *parent) :
QPlaceTextPredictionReply(parent),
restReply(reply)
{
@@ -79,20 +79,20 @@ QPlaceTextPreditionReplyImpl::QPlaceTextPreditionReplyImpl(QPlaceRestReply *repl
/*!
Destructor.
*/
-QPlaceTextPreditionReplyImpl::~QPlaceTextPreditionReplyImpl()
+QPlaceTextPredictionReplyImpl::~QPlaceTextPredictionReplyImpl()
{
}
-void QPlaceTextPreditionReplyImpl::abort()
+void QPlaceTextPredictionReplyImpl::abort()
{
if (restReply)
restReply->cancelProcessing();
}
-void QPlaceTextPreditionReplyImpl::restError(QPlaceRestReply::Error errorId)
+void QPlaceTextPredictionReplyImpl::restError(QPlaceRestReply::Error errorId)
{
if (errorId == QPlaceRestReply::Canceled) {
- this->setError(CancelError, "ReauestCanceled");
+ this->setError(CancelError, "RequestCanceled");
} else if (errorId == QPlaceRestReply::NetworkError) {
this->setError(CommunicationError, "Network error");
}
@@ -103,7 +103,7 @@ void QPlaceTextPreditionReplyImpl::restError(QPlaceRestReply::Error errorId)
emit processingFinished(this);
}
-void QPlaceTextPreditionReplyImpl::resultReady(const QPlaceJSonParser::Error &errorId,
+void QPlaceTextPredictionReplyImpl::resultReady(const QPlaceJSonParser::Error &errorId,
const QString &errorMessage)
{
if (errorId == QPlaceJSonParser::NoError) {
diff --git a/src/plugins/places/nokia/qplacetextpredictionreplyimpl.h b/src/plugins/places/nokia/qplacetextpredictionreplyimpl.h
index ed6e8e31..bc660b02 100644
--- a/src/plugins/places/nokia/qplacetextpredictionreplyimpl.h
+++ b/src/plugins/places/nokia/qplacetextpredictionreplyimpl.h
@@ -58,12 +58,12 @@
QT_BEGIN_NAMESPACE
-class QPlaceTextPreditionReplyImpl : public QPlaceTextPredictionReply
+class QPlaceTextPredictionReplyImpl : public QPlaceTextPredictionReply
{
Q_OBJECT
public:
- explicit QPlaceTextPreditionReplyImpl(QPlaceRestReply *reply, QObject *parent = 0);
- ~QPlaceTextPreditionReplyImpl();
+ explicit QPlaceTextPredictionReplyImpl(QPlaceRestReply *reply, QObject *parent = 0);
+ ~QPlaceTextPredictionReplyImpl();
void abort();
Q_SIGNALS: