diff options
author | abcd <qt-info@nokia.com> | 2011-08-15 20:31:44 +1000 |
---|---|---|
committer | abcd <qt_abcd1@ovi.com> | 2011-08-19 08:29:34 +0200 |
commit | 2c829671005e6572ae6e048aa337bb8b3ca639f9 (patch) | |
tree | 23327410fc8d413780f75b3b15ea9be25a7a795e | |
parent | 6065485d10f9d783d9ac60b4219ed7bf56f57a82 (diff) | |
download | qtlocation-2c829671005e6572ae6e048aa337bb8b3ca639f9.tar.gz |
Remove BusinessInformation,BusinessFeature and weekdayhours
These have beens superseded by the PlaceAttribute class.
We do not have attribute keys for the closing notes,at they moment
they are pointless without a time period that is relevant for the
closing note.
We do not have attribute key for the opening hours yet since we have
yet to implement that in the plugin.
we do no yet attribute keys for business features because we never
had any to work with from the start.
Change-Id: I1a8749b1a598b4928a9c197cb5f4bde7615cdf8f
Reviewed-on: http://codereview.qt.nokia.com/2949
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: abcd <qt_abcd1@ovi.com>
32 files changed, 67 insertions, 2019 deletions
diff --git a/src/imports/location/declarativeplaces/declarativeplaces.pri b/src/imports/location/declarativeplaces/declarativeplaces.pri index 9127626f..42e08252 100644 --- a/src/imports/location/declarativeplaces/declarativeplaces.pri +++ b/src/imports/location/declarativeplaces/declarativeplaces.pri @@ -8,19 +8,15 @@ SOURCES += \ declarativeplaces/qdeclarativereviewmodel.cpp \ declarativeplaces/qdeclarativemediamodel.cpp \ #data - declarativeplaces/qdeclarativebusinessfeature.cpp \ - declarativeplaces/qdeclarativebusinessinformation.cpp \ declarativeplaces/qdeclarativecategory.cpp \ declarativeplaces/qdeclarativedescription.cpp \ declarativeplaces/qdeclarativemediaobject.cpp \ - declarativeplaces/qdeclarativeperiod.cpp \ declarativeplaces/qdeclarativeplace.cpp \ declarativeplaces/qdeclarativeplaceattribute.cpp \ declarativeplaces/qdeclarativerating.cpp \ declarativeplaces/qdeclarativereview.cpp \ declarativeplaces/qdeclarativesearchresult.cpp \ - declarativeplaces/qdeclarativesupplier.cpp \ - declarativeplaces/qdeclarativeweekdayhours.cpp + declarativeplaces/qdeclarativesupplier.cpp HEADERS += \ #models @@ -31,19 +27,15 @@ HEADERS += \ declarativeplaces/qdeclarativereviewmodel_p.h \ declarativeplaces/qdeclarativemediamodel_p.h \ #data - declarativeplaces/qdeclarativebusinessfeature_p.h \ - declarativeplaces/qdeclarativebusinessinformation_p.h \ declarativeplaces/qdeclarativecategory_p.h \ declarativeplaces/qdeclarativedescription_p.h \ declarativeplaces/qdeclarativemediaobject_p.h \ - declarativeplaces/qdeclarativeperiod_p.h \ declarativeplaces/qdeclarativeplace_p.h \ declarativeplaces/qdeclarativeplaceattribute_p.h \ declarativeplaces/qdeclarativerating_p.h \ declarativeplaces/qdeclarativereview_p.h \ declarativeplaces/qdeclarativesearchresult_p.h \ - declarativeplaces/qdeclarativesupplier_p.h \ - declarativeplaces/qdeclarativeweekdayhours_p.h + declarativeplaces/qdeclarativesupplier_p.h diff --git a/src/imports/location/declarativeplaces/qdeclarativebusinessinformation.cpp b/src/imports/location/declarativeplaces/qdeclarativebusinessinformation.cpp deleted file mode 100644 index bf0c7701..00000000 --- a/src/imports/location/declarativeplaces/qdeclarativebusinessinformation.cpp +++ /dev/null @@ -1,357 +0,0 @@ -#include "qdeclarativebusinessinformation_p.h" - -QT_USE_NAMESPACE - -/*! - \qmlclass BusinessInformation - - \brief The BusinessInformation element holds business information data. - \inherits QObject - - BusinessInformation cointains many properties holding data of the place like - business features, openning hours, etc. - - \ingroup qml-places -*/ - -QDeclarativeBusinessInformation::QDeclarativeBusinessInformation(QObject* parent) - : QObject(parent) -{ -} - -QDeclarativeBusinessInformation::QDeclarativeBusinessInformation(const QPlaceBusinessInformation &src, - QObject *parent) - : QObject(parent), - m_src(src) -{ - synchronizeFeatures(); - synchronizeOpeningHours(); - synchronizeAnnualClosings(); -} - -QDeclarativeBusinessInformation::~QDeclarativeBusinessInformation() -{ -} - -void QDeclarativeBusinessInformation::setBusinessInformation(const QPlaceBusinessInformation &src) -{ - QPlaceBusinessInformation previous = m_src; - m_src = src; - - if (previous.additionalData() != m_src.additionalData()) { - emit additionalDataChanged(); - } - if (previous.features() != m_src.features()) { - synchronizeFeatures(); - emit featuresChanged(); - } - if (previous.openingHours() != m_src.openingHours()) { - synchronizeOpeningHours(); - emit openingHoursChanged(); - } - if (previous.annualClosings() != m_src.annualClosings()) { - synchronizeAnnualClosings(); - emit annualClosingsChanged(); - } - if (previous.annualClosingNote() != m_src.annualClosingNote()) { - emit annualClosingNoteChanged(); - } - if (previous.openingNote() != m_src.openingNote()) { - emit openingNoteChanged(); - } - if (previous.paymentMethods() != m_src.paymentMethods()) { - emit paymentMethodsChanged(); - } -} - -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; -} - -/*! - \qmlproperty QVariantHash BusinessInformation::additionalData - - This property holds additional data for business information. - Those are pairs of strings (key/value). -*/ - -void QDeclarativeBusinessInformation::setAdditionalData(const QVariantHash &additionalData) -{ - if (m_src.additionalData() != additionalData) { - m_src.setAdditionalData(additionalData); - emit additionalDataChanged(); - } -} - -QVariantHash QDeclarativeBusinessInformation::additionalData() const -{ - return m_src.additionalData(); -} - -/*! - \qmlproperty string BusinessInformation::annualClosingNote - - This property holds annual closing note. -*/ -void QDeclarativeBusinessInformation::setAnnualClosingNote(const QString &data) -{ - if (m_src.annualClosingNote() != data) { - m_src.setAnnualClosingNote(data); - emit annualClosingNoteChanged(); - } -} - -QString QDeclarativeBusinessInformation::annualClosingNote() const -{ - return m_src.annualClosingNote(); -} - -/*! - \qmlproperty string BusinessInformation::openingNote - - This property holds oppening note. -*/ -void QDeclarativeBusinessInformation::setOpeningNote(const QString &data) -{ - if (m_src.openingNote() != data) { - m_src.setOpeningNote(data); - emit annualClosingNoteChanged(); - } -} - -QString QDeclarativeBusinessInformation::openingNote() const -{ - return m_src.openingNote(); -} - -/*! - \qmlproperty stringlist BusinessInformation::paymentMethods - - This property holds payment methods list. -*/ -void QDeclarativeBusinessInformation::setPaymentMethods(const QStringList &data) -{ - if (m_src.paymentMethods() != data) { - m_src.setPaymentMethods(data); - emit paymentMethodsChanged(); - } -} - -QStringList QDeclarativeBusinessInformation::paymentMethods() const -{ - return m_src.paymentMethods(); -} - -/*! - \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() -{ - return QDeclarativeListProperty<QDeclarativeBusinessFeature>(this, - 0, // opaque data parameter - features_append, - features_count, - features_at, - features_clear); -} - -void QDeclarativeBusinessInformation::features_append(QDeclarativeListProperty<QDeclarativeBusinessFeature> *prop, - QDeclarativeBusinessFeature *value) -{ - QDeclarativeBusinessInformation* object = static_cast<QDeclarativeBusinessInformation*>(prop->object); - QDeclarativeBusinessFeature *altValue = new QDeclarativeBusinessFeature(object); - altValue->setBusinessFeature(value->businessFeature()); - object->m_features.append(altValue); - QList<QPlaceBusinessFeature> list = object->m_src.features(); - list.append(value->businessFeature()); - object->m_src.setFeatures(list); - emit object->featuresChanged(); -} - -int QDeclarativeBusinessInformation::features_count(QDeclarativeListProperty<QDeclarativeBusinessFeature> *prop) -{ - return static_cast<QDeclarativeBusinessInformation*>(prop->object)->m_features.count(); -} - -QDeclarativeBusinessFeature* QDeclarativeBusinessInformation::features_at(QDeclarativeListProperty<QDeclarativeBusinessFeature> *prop, - int index) -{ - QDeclarativeBusinessInformation* object = static_cast<QDeclarativeBusinessInformation*>(prop->object); - QDeclarativeBusinessFeature *res = NULL; - if (object->m_features.count() > index && index > -1) { - res = object->m_features[index]; - } - return res; -} - -void QDeclarativeBusinessInformation::features_clear(QDeclarativeListProperty<QDeclarativeBusinessFeature> *prop) -{ - QDeclarativeBusinessInformation* object = static_cast<QDeclarativeBusinessInformation*>(prop->object); - qDeleteAll(object->m_features); - object->m_features.clear(); - object->m_src.setFeatures(QList<QPlaceBusinessFeature>()); - emit object->featuresChanged(); -} - -void QDeclarativeBusinessInformation::synchronizeFeatures() -{ - qDeleteAll(m_features); - m_features.clear(); - foreach (QPlaceBusinessFeature value, m_src.features()) { - QDeclarativeBusinessFeature* declarativeValue = new QDeclarativeBusinessFeature(value, this); - m_features.append(declarativeValue); - } -} - -/*! - \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() -{ - return QDeclarativeListProperty<QDeclarativeWeekdayHours>(this, - 0, // opaque data parameter - openingHours_append, - openingHours_count, - openingHours_at, - openingHours_clear); -} - -void QDeclarativeBusinessInformation::openingHours_append(QDeclarativeListProperty<QDeclarativeWeekdayHours> *prop, - QDeclarativeWeekdayHours *value) -{ - QDeclarativeBusinessInformation* object = static_cast<QDeclarativeBusinessInformation*>(prop->object); - QDeclarativeWeekdayHours *altValue = new QDeclarativeWeekdayHours(object); - altValue->setWeekdayHours(value->weekdayHours()); - object->m_openingHours.append(altValue); - QList<QPlaceWeekdayHours> list = object->m_src.openingHours(); - list.append(value->weekdayHours()); - object->m_src.setOpeningHours(list); - emit object->openingHoursChanged(); -} - -int QDeclarativeBusinessInformation::openingHours_count(QDeclarativeListProperty<QDeclarativeWeekdayHours> *prop) -{ - return static_cast<QDeclarativeBusinessInformation*>(prop->object)->m_openingHours.count(); -} - -QDeclarativeWeekdayHours* QDeclarativeBusinessInformation::openingHours_at(QDeclarativeListProperty<QDeclarativeWeekdayHours> *prop, - int index) -{ - QDeclarativeBusinessInformation* object = static_cast<QDeclarativeBusinessInformation*>(prop->object); - QDeclarativeWeekdayHours *res = NULL; - if (object->m_openingHours.count() > index && index > -1) { - res = object->m_openingHours[index]; - } - return res; -} - -void QDeclarativeBusinessInformation::openingHours_clear(QDeclarativeListProperty<QDeclarativeWeekdayHours> *prop) -{ - QDeclarativeBusinessInformation* object = static_cast<QDeclarativeBusinessInformation*>(prop->object); - qDeleteAll(object->m_openingHours); - object->m_openingHours.clear(); - object->m_src.setOpeningHours(QList<QPlaceWeekdayHours>()); - emit object->openingHoursChanged(); -} - -void QDeclarativeBusinessInformation::synchronizeOpeningHours() -{ - qDeleteAll(m_openingHours); - m_openingHours.clear(); - foreach (QPlaceWeekdayHours value, m_src.openingHours()) { - QDeclarativeWeekdayHours* declarativeValue = new QDeclarativeWeekdayHours(value, this); - m_openingHours.append(declarativeValue); - } -} - -/*! - \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() -{ - return QDeclarativeListProperty<QDeclarativePeriod>(this, - 0, // opaque data parameter - annualClosings_append, - annualClosings_count, - annualClosings_at, - annualClosings_clear); -} - -void QDeclarativeBusinessInformation::annualClosings_append(QDeclarativeListProperty<QDeclarativePeriod> *prop, - QDeclarativePeriod *value) -{ - QDeclarativeBusinessInformation* object = static_cast<QDeclarativeBusinessInformation*>(prop->object); - QDeclarativePeriod *altValue = new QDeclarativePeriod(object); - altValue->setPeriod(value->period()); - object->m_annualClosings.append(altValue); - QList<QPlacePeriod> list = object->m_src.annualClosings(); - list.append(value->period()); - object->m_src.setAnnualClosings(list); - emit object->annualClosingNoteChanged(); -} - -int QDeclarativeBusinessInformation::annualClosings_count(QDeclarativeListProperty<QDeclarativePeriod> *prop) -{ - return static_cast<QDeclarativeBusinessInformation*>(prop->object)->m_annualClosings.count(); -} - -QDeclarativePeriod* QDeclarativeBusinessInformation::annualClosings_at(QDeclarativeListProperty<QDeclarativePeriod> *prop, - int index) -{ - QDeclarativeBusinessInformation* object = static_cast<QDeclarativeBusinessInformation*>(prop->object); - QDeclarativePeriod *res = NULL; - if (object->m_annualClosings.count() > index && index > -1) { - res = object->m_annualClosings[index]; - } - return res; -} - -void QDeclarativeBusinessInformation::annualClosings_clear(QDeclarativeListProperty<QDeclarativePeriod> *prop) -{ - QDeclarativeBusinessInformation* object = static_cast<QDeclarativeBusinessInformation*>(prop->object); - qDeleteAll(object->m_annualClosings); - object->m_annualClosings.clear(); - object->m_src.setAnnualClosings(QList<QPlacePeriod>()); - emit object->annualClosingNoteChanged(); -} - -void QDeclarativeBusinessInformation::synchronizeAnnualClosings() -{ - qDeleteAll(m_annualClosings); - m_annualClosings.clear(); - foreach (QPlacePeriod value, m_src.annualClosings()) { - QDeclarativePeriod* declarativeValue = new QDeclarativePeriod(value, this); - m_annualClosings.append(declarativeValue); - } -} diff --git a/src/imports/location/declarativeplaces/qdeclarativebusinessinformation_p.h b/src/imports/location/declarativeplaces/qdeclarativebusinessinformation_p.h deleted file mode 100644 index abb73857..00000000 --- a/src/imports/location/declarativeplaces/qdeclarativebusinessinformation_p.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef QDECLARATIVEBUSINESSINFORMATION_P_H -#define QDECLARATIVEBUSINESSINFORMATION_P_H - -#include <QObject> -#include <QDeclarativeListProperty> -#include <qplacebusinessinformation.h> -#include "qdeclarativebusinessfeature_p.h" -#include "qdeclarativeperiod_p.h" -#include "qdeclarativeweekdayhours_p.h" - -QT_BEGIN_NAMESPACE - -class QDeclarativeBusinessInformation : public QObject -{ - Q_OBJECT - - Q_PROPERTY(QVariantHash additionalData READ additionalData WRITE setAdditionalData NOTIFY additionalDataChanged); - Q_PROPERTY(QDeclarativeListProperty<QDeclarativeBusinessFeature> features READ features NOTIFY featuresChanged) - Q_PROPERTY(QDeclarativeListProperty<QDeclarativeWeekdayHours> openingHours READ openingHours NOTIFY openingHoursChanged) - Q_PROPERTY(QDeclarativeListProperty<QDeclarativePeriod> annualClosings READ annualClosings NOTIFY annualClosingsChanged) - Q_PROPERTY(QString annualClosingNote READ annualClosingNote WRITE setAnnualClosingNote NOTIFY annualClosingNoteChanged); - Q_PROPERTY(QString openingNote READ openingNote WRITE setOpeningNote NOTIFY openingNoteChanged); - Q_PROPERTY(QStringList paymentMethods READ paymentMethods WRITE setPaymentMethods NOTIFY paymentMethodsChanged); - -public: - explicit QDeclarativeBusinessInformation(QObject* parent = 0); - explicit QDeclarativeBusinessInformation(const QPlaceBusinessInformation &src, - QObject* parent = 0); - ~QDeclarativeBusinessInformation(); - - QPlaceBusinessInformation businessInformation(); - void setBusinessInformation(const QPlaceBusinessInformation &src); - - QVariantHash additionalData() const; - void setAdditionalData(const QVariantHash &data); - QDeclarativeListProperty<QDeclarativeBusinessFeature> features(); - static void features_append(QDeclarativeListProperty<QDeclarativeBusinessFeature> *prop, - QDeclarativeBusinessFeature* value); - static int features_count(QDeclarativeListProperty<QDeclarativeBusinessFeature> *prop); - static QDeclarativeBusinessFeature* features_at(QDeclarativeListProperty<QDeclarativeBusinessFeature> *prop, int index); - static void features_clear(QDeclarativeListProperty<QDeclarativeBusinessFeature> *prop); - QDeclarativeListProperty<QDeclarativePeriod> annualClosings(); - static void annualClosings_append(QDeclarativeListProperty<QDeclarativePeriod> *prop, - QDeclarativePeriod* value); - static int annualClosings_count(QDeclarativeListProperty<QDeclarativePeriod> *prop); - static QDeclarativePeriod* annualClosings_at(QDeclarativeListProperty<QDeclarativePeriod> *prop, int index); - static void annualClosings_clear(QDeclarativeListProperty<QDeclarativePeriod> *prop); - QDeclarativeListProperty<QDeclarativeWeekdayHours> openingHours(); - static void openingHours_append(QDeclarativeListProperty<QDeclarativeWeekdayHours> *prop, - QDeclarativeWeekdayHours* value); - static int openingHours_count(QDeclarativeListProperty<QDeclarativeWeekdayHours> *prop); - static QDeclarativeWeekdayHours* openingHours_at(QDeclarativeListProperty<QDeclarativeWeekdayHours> *prop, int index); - static void openingHours_clear(QDeclarativeListProperty<QDeclarativeWeekdayHours> *prop); - QString annualClosingNote() const; - void setAnnualClosingNote(const QString &data); - QString openingNote() const; - void setOpeningNote(const QString &data); - QStringList paymentMethods() const; - void setPaymentMethods(const QStringList &data); - -signals: - void additionalDataChanged(); - void featuresChanged(); - void openingHoursChanged(); - void annualClosingsChanged(); - void annualClosingNoteChanged(); - void openingNoteChanged(); - void paymentMethodsChanged(); - -private: - void synchronizeFeatures(); - void synchronizeOpeningHours(); - void synchronizeAnnualClosings(); - -private: - QList<QDeclarativeBusinessFeature*> m_features; - QList<QDeclarativePeriod*> m_annualClosings; - QList<QDeclarativeWeekdayHours*> m_openingHours; - - QPlaceBusinessInformation m_src; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeBusinessInformation)); - -#endif // QDECLARATIVEBUSINESSINFORMATION_P_H diff --git a/src/imports/location/declarativeplaces/qdeclarativeperiod.cpp b/src/imports/location/declarativeplaces/qdeclarativeperiod.cpp deleted file mode 100644 index 2c54fc06..00000000 --- a/src/imports/location/declarativeplaces/qdeclarativeperiod.cpp +++ /dev/null @@ -1,119 +0,0 @@ -#include "qdeclarativeperiod_p.h" - -QT_USE_NAMESPACE - -/*! - \qmlclass Period - - \brief The Period element holds various time slot data, such as - begining and end dates. - \inherits QObject - - \ingroup qml-places -*/ - -QDeclarativePeriod::QDeclarativePeriod(QObject* parent) - : QObject(parent) {} - -QDeclarativePeriod::QDeclarativePeriod(const QPlacePeriod &period, - QObject *parent) - : QObject(parent), - m_period(period) {} - -QDeclarativePeriod::~QDeclarativePeriod() {} - -void QDeclarativePeriod::setPeriod(const QPlacePeriod &period) -{ - QPlacePeriod previousPeriod = m_period; - m_period = period; - - if (period.startDate() != previousPeriod.startDate()) { - emit startDateChanged(); - } - if (period.startTime() != previousPeriod.startTime()) { - emit startTimeChanged(); - } - if (period.endDate() != previousPeriod.endDate()) { - emit endDateChanged(); - } - if (period.endTime() != previousPeriod.endTime()) { - emit endTimeChanged(); - } -} - -QPlacePeriod QDeclarativePeriod::period() const -{ - return m_period; -} - -/*! - \qmlproperty QDate Period::startDate - - This property holds the begining date. -*/ -void QDeclarativePeriod::setStartDate(const QDate &startDate) -{ - if (m_period.startDate() != startDate) { - m_period.setStartDate(startDate); - emit startDateChanged(); - } -} - -QDate QDeclarativePeriod::startDate() const -{ - return m_period.startDate(); -} - -/*! - \qmlproperty QTime Period::startTime - - This property holds the begining time. -*/ -void QDeclarativePeriod::setStartTime(const QTime &startTime) -{ - if (m_period.startTime() != startTime) { - m_period.setStartTime(startTime); - emit startTimeChanged(); - } -} - -QTime QDeclarativePeriod::startTime() const -{ - return m_period.startTime(); -} - -/*! - \qmlproperty QDate Period::endDate - - This property holds the ending date. -*/ -void QDeclarativePeriod::setEndDate(const QDate &endDate) -{ - if (m_period.endDate() != endDate) { - m_period.setEndDate(endDate); - emit endDateChanged(); - } -} - -QDate QDeclarativePeriod::endDate() const -{ - return m_period.endDate(); -} - -/*! - \qmlproperty QTime Period::endTime - - This property holds the ending time. -*/ -void QDeclarativePeriod::setEndTime(const QTime &endTime) -{ - if (m_period.endTime() != endTime) { - m_period.setEndTime(endTime); - emit endTimeChanged(); - } -} - -QTime QDeclarativePeriod::endTime() const -{ - return m_period.endTime(); -} diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp index 76bb302a..7a7eae4e 100644 --- a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp @@ -36,7 +36,6 @@ QDeclarativePlace::QDeclarativePlace(const QGeoPlace &src, QObject *parent) m_rating.setRating(m_src.rating()); m_location.setLocation(m_src.location()); - m_businessInformation.setBusinessInformation(m_src.businessInformation()); } QDeclarativePlace::~QDeclarativePlace() @@ -98,10 +97,6 @@ void QDeclarativePlace::setPlace(const QGeoPlace &src) if (previous.additionalData() != m_src.additionalData()) { emit additionalDataChanged(); } - if (previous.businessInformation() != m_src.businessInformation()) { - m_businessInformation.setBusinessInformation(m_src.businessInformation()); - emit businessInformationChanged(); - } if (previous.categories() != m_src.categories()) { synchronizeCategories(); emit categoriesChanged(); @@ -184,7 +179,6 @@ QGeoPlace QDeclarativePlace::place() suppliers.append(value->supplier()); } m_src.setSuppliers(suppliers); - m_src.setBusinessInformation(m_businessInformation.businessInformation()); return m_src; } @@ -252,28 +246,6 @@ 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) -{ - if (m_src.businessInformation() != obj->businessInformation()) { - m_businessInformation.setBusinessInformation(obj->businessInformation()); - m_src.setBusinessInformation(obj->businessInformation()); - emit businessInformationChanged(); - } -} - -QDeclarativeBusinessInformation *QDeclarativePlace::businessInformation() -{ - return &m_businessInformation; -} - -/*! \qmlproperty string Place::name This property holds name. diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace_p.h b/src/imports/location/declarativeplaces/qdeclarativeplace_p.h index 4ef3b3af..b049eef7 100644 --- a/src/imports/location/declarativeplaces/qdeclarativeplace_p.h +++ b/src/imports/location/declarativeplaces/qdeclarativeplace_p.h @@ -5,7 +5,6 @@ #include <QDeclarativeListProperty> #include <qgeoplace.h> #include "qdeclarativegeolocation_p.h" -#include "qdeclarativebusinessinformation_p.h" #include "qdeclarativecategory_p.h" #include "qdeclarativesupplier_p.h" #include "qdeclarativerating_p.h" @@ -27,7 +26,6 @@ class QDeclarativePlace : public QObject, public QDeclarativeParserStatus Q_PROPERTY(QDeclarativeListProperty<QDeclarativeCategory> categories READ categories NOTIFY categoriesChanged) Q_PROPERTY(QDeclarativeListProperty<QDeclarativeDescription> descriptions READ descriptions NOTIFY descriptionsChanged) Q_PROPERTY(QDeclarativeGeoLocation* location READ location WRITE setLocation NOTIFY locationChanged); - Q_PROPERTY(QDeclarativeBusinessInformation* businessInformation READ businessInformation WRITE setBusinessInformation NOTIFY businessInformationChanged); Q_PROPERTY(QDeclarativeRating* rating READ rating WRITE setRating NOTIFY ratingChanged); Q_PROPERTY(QDeclarativeListProperty<QDeclarativeSupplier> suppliers READ suppliers NOTIFY suppliersChanged) Q_PROPERTY(QStringList feeds READ feeds WRITE setFeeds NOTIFY feedsChanged); @@ -95,8 +93,6 @@ public: void setName(const QString &name); QString placeId() const; void setPlaceId(const QString &placeId); - QDeclarativeBusinessInformation *businessInformation(); - void setBusinessInformation(QDeclarativeBusinessInformation *business); QString shortDescription() const; void setShortDescription(const QString &description); QStringList tags() const; @@ -166,7 +162,6 @@ private: QDeclarativeGeoLocation m_location; QDeclarativeRating m_rating; QList<QDeclarativeSupplier*> m_suppliers; - QDeclarativeBusinessInformation m_businessInformation; QDeclarativeReviewModel *m_reviewModel; QDeclarativeMediaModel *m_mediaModel; QDeclarativePropertyMap *m_extendedAttributes; diff --git a/src/imports/location/declarativeplaces/qdeclarativeweekdayhours.cpp b/src/imports/location/declarativeplaces/qdeclarativeweekdayhours.cpp deleted file mode 100644 index 9c9ec704..00000000 --- a/src/imports/location/declarativeplaces/qdeclarativeweekdayhours.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include "qdeclarativeweekdayhours_p.h" - -QT_USE_NAMESPACE - -/*! - \qmlclass WeekdayHours - - \brief The WeekdayHours element holds various positional data, such as \l - latitude and \l longitude and. - \inherits QObject - - \ingroup qml-places -*/ - -QDeclarativeWeekdayHours::QDeclarativeWeekdayHours(QObject* parent) - : QObject(parent) {} - -QDeclarativeWeekdayHours::QDeclarativeWeekdayHours(const QPlaceWeekdayHours &weekdayHours, - QObject *parent) - : QObject(parent), - m_period(weekdayHours.period()), - m_weekdayHours(weekdayHours) {} - -QDeclarativeWeekdayHours::~QDeclarativeWeekdayHours() {} - -void QDeclarativeWeekdayHours::setWeekdayHours(const QPlaceWeekdayHours &weekdayHours) -{ - QPlaceWeekdayHours previousWeekdayHours = m_weekdayHours; - m_weekdayHours = weekdayHours; - - if (m_weekdayHours.weekday() != previousWeekdayHours.weekday()) { - emit weekdayChanged(); - } - if (m_weekdayHours.period() != previousWeekdayHours.period()) { - m_period.setPeriod(m_weekdayHours.period()); - emit periodChanged(); - } -} - -QPlaceWeekdayHours QDeclarativeWeekdayHours::weekdayHours() -{ - m_weekdayHours.setPeriod(m_period.period()); - return m_weekdayHours; -} - -/*! - \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) -{ - if (m_weekdayHours.weekday() != weekday) { - m_weekdayHours.setWeekday(weekday); - emit weekdayChanged(); - } -} - -Qt::DayOfWeek QDeclarativeWeekdayHours::weekday() const -{ - return m_weekdayHours.weekday(); -} - -/*! - \qmlproperty double WeekdayHours::period - - This property holds period time. -*/ - -void QDeclarativeWeekdayHours::setPeriod(QDeclarativePeriod *period) -{ - if (m_period.period() != period->period()) { - m_period.setPeriod(period->period()); - emit periodChanged(); - } -} - -QDeclarativePeriod* QDeclarativeWeekdayHours::period() -{ - return &m_period; -} diff --git a/src/imports/location/declarativeplaces/qdeclarativeweekdayhours_p.h b/src/imports/location/declarativeplaces/qdeclarativeweekdayhours_p.h deleted file mode 100644 index b3b1d4af..00000000 --- a/src/imports/location/declarativeplaces/qdeclarativeweekdayhours_p.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef QDECLARATIVEWEEKDAYHOURS_P_H -#define QDECLARATIVEWEEKDAYHOURS_P_H - -#include <qplaceweekdayhours.h> -#include <QtDeclarative/qdeclarative.h> -#include <QObject> - -#include "qdeclarativeperiod_p.h" - -QT_BEGIN_NAMESPACE - -class QDeclarativeWeekdayHours : public QObject -{ - Q_OBJECT - - Q_PROPERTY(QDeclarativePeriod* period READ period WRITE setPeriod NOTIFY periodChanged) - Q_PROPERTY(Qt::DayOfWeek weekday READ weekday WRITE setWeekday NOTIFY weekdayChanged) - -public: - explicit QDeclarativeWeekdayHours(QObject* parent = 0); - explicit QDeclarativeWeekdayHours(const QPlaceWeekdayHours &weekdayHours, QObject* parent = 0); - ~QDeclarativeWeekdayHours(); - - QPlaceWeekdayHours weekdayHours(); - void setWeekdayHours(const QPlaceWeekdayHours &weekdayHours); - - QDeclarativePeriod *period(); - void setPeriod(QDeclarativePeriod *period); - Qt::DayOfWeek weekday() const; - void setWeekday(const Qt::DayOfWeek &weekday); - -signals: - void periodChanged(); - void weekdayChanged(); - -private: - QDeclarativePeriod m_period; - QPlaceWeekdayHours m_weekdayHours; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeWeekdayHours)); - -#endif // QDECLARATIVEWEEKDAYHOURS_P_H diff --git a/src/imports/location/location.cpp b/src/imports/location/location.cpp index 86152132..a4856042 100644 --- a/src/imports/location/location.cpp +++ b/src/imports/location/location.cpp @@ -75,8 +75,6 @@ #include "qdeclarativegeomaneuver_p.h" //Place includes -#include "qdeclarativebusinessfeature_p.h" -#include "qdeclarativebusinessinformation_p.h" #include "qdeclarativecategory_p.h" #include "qdeclarativedescription_p.h" #include "qdeclarativegeolocation_p.h" @@ -193,21 +191,17 @@ public: qmlRegisterType<QDeclarativeGeoRouteSegment>(uri, 5, 0, "RouteSegment"); qmlRegisterType<QDeclarativeGeoManeuver>(uri, 5, 0, "RouteManeuver"); - qmlRegisterType<QDeclarativeBusinessFeature>(uri, 5, 0, "BusinessFeature"); - qmlRegisterType<QDeclarativeBusinessInformation>(uri, 5, 0, "BusinessInformation"); qmlRegisterType<QDeclarativeCategory>(uri, 5, 0, "Category"); qmlRegisterType<QDeclarativeDescription>(uri, 5, 0, "Description"); qmlRegisterType<QDeclarativeGeoLocation>(uri, 5, 0, "Location"); qmlRegisterType<QDeclarativeMediaObject>(uri, 5, 0, "MediaObject"); qmlRegisterType<QDeclarativeMediaModel>(uri, 5, 0, "MediaModel"); - qmlRegisterType<QDeclarativePeriod>(uri, 5, 0, "Period"); qmlRegisterType<QDeclarativePlace>(uri, 5, 0, "Place"); qmlRegisterType<QDeclarativeRating>(uri, 5, 0, "Rating"); qmlRegisterType<QDeclarativeReview>(uri, 5, 0, "Review"); qmlRegisterType<QDeclarativeReviewModel>(uri, 5, 0, "ReviewModel"); qmlRegisterType<QDeclarativeSearchResult>(uri, 5, 0, "SearchResult"); qmlRegisterType<QDeclarativeSupplier>(uri, 5, 0, "Supplier"); - qmlRegisterType<QDeclarativeWeekdayHours>(uri, 5, 0, "WeekdayHours"); qmlRegisterType<QDeclarativeRecommendationModel>(uri, 5, 0, "RecommendationModel"); qmlRegisterType<QDeclarativeSupportedCategoriesModel>(uri, 5, 0, "SupportedCategoriesModel"); diff --git a/src/location/places/places.pri b/src/location/places/places.pri index 24ce39d2..08e052d8 100644 --- a/src/location/places/places.pri +++ b/src/location/places/places.pri @@ -4,8 +4,6 @@ INCLUDEPATH += places PUBLIC_HEADERS += \ #data classes places/qplaceattribute.h \ - places/qplacebusinessfeature.h \ - places/qplacebusinessinformation.h \ places/qplacecategory.h \ places/qplacedescription.h \ places/qplacemediaobject.h \ @@ -14,7 +12,6 @@ PUBLIC_HEADERS += \ places/qplacerating.h \ places/qplacereview.h \ places/qplacesupplier.h \ - places/qplaceweekdayhours.h \ #result places/qplacesearchresult.h \ #query classes @@ -35,8 +32,6 @@ PUBLIC_HEADERS += \ PRIVATE_HEADERS += \ places/qplaceattribute_p.h \ - places/qplacebusinessfeature_p.h \ - places/qplacebusinessinformation_p.h \ places/qplacecategory_p.h \ places/qplacedescription_p.h \ places/qplacemediaobject_p.h \ @@ -44,7 +39,6 @@ PRIVATE_HEADERS += \ places/qplacerating_p.h \ places/qplacereview_p.h \ places/qplacesupplier_p.h \ - places/qplaceweekdayhours_p.h \ places/qplacesearchresult_p.h \ places/qplacereply_p.h \ places/qplacemanager_p.h \ @@ -53,17 +47,15 @@ PRIVATE_HEADERS += \ SOURCES += \ #data classes places/qplaceattribute.cpp \ - places/qplacebusinessfeature.cpp \ - places/qplacebusinessinformation.cpp \ places/qplacecategory.cpp \ places/qplacedescription.cpp \ +#result places/qplacemediaobject.cpp \ places/qplaceperiod.cpp \ places/qplacerating.cpp \ places/qplacereview.cpp \ places/qplacesavereply.cpp \ places/qplacesupplier.cpp \ - places/qplaceweekdayhours.cpp \ #result places/qplacesearchresult.cpp \ #query classes diff --git a/src/location/places/qplaceattribute.cpp b/src/location/places/qplaceattribute.cpp index b0c1f674..d4112f22 100644 --- a/src/location/places/qplaceattribute.cpp +++ b/src/location/places/qplaceattribute.cpp @@ -66,6 +66,20 @@ bool QPlaceAttributePrivate::operator== (const QPlaceAttributePrivate &other) co } /*! + \variable QPlaceAttribute::OpeningNote + The key for the attribute that holds special instructions during opening hours + e.g. "use buzzer for entry" +*/ +Q_DEFINE_LATIN1_CONSTANT(QPlaceAttribute::OpeningNote, "openingNote"); + +/*! + \variable QPlaceAttribute::PaymentMethods + The key for the attribute that holds accepted payment methods such + as visa or mastercard. +*/ +Q_DEFINE_LATIN1_CONSTANT(QPlaceAttribute::PaymentMethods, "paymentMethods"); + +/*! \class QPlaceAttribute \brief The QPlaceAttribute class represents generic attribute information about a place. \inmodule QtLocation diff --git a/src/location/places/qplaceattribute.h b/src/location/places/qplaceattribute.h index 9da9d540..6419d464 100644 --- a/src/location/places/qplaceattribute.h +++ b/src/location/places/qplaceattribute.h @@ -46,6 +46,8 @@ #include <QVariant> #include <QSharedDataPointer> +#include <qlatin1constant.h> + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -54,6 +56,14 @@ class QPlaceAttributePrivate; class Q_LOCATION_EXPORT QPlaceAttribute { public: +#ifdef Q_QDOC + static const QLatin1Constant OpeningNote; + static const QLatin1Constant PaymentMethods; +#else + Q_DECLARE_LATIN1_CONSTANT(OpeningNote, "openingNote"); + Q_DECLARE_LATIN1_CONSTANT(PaymentMethods, "paymentMethods"); +#endif + QPlaceAttribute(); QPlaceAttribute(const QPlaceAttribute &other); virtual ~QPlaceAttribute(); diff --git a/src/location/places/qplacebusinessfeature.cpp b/src/location/places/qplacebusinessfeature.cpp deleted file mode 100644 index c82d5a48..00000000 --- a/src/location/places/qplacebusinessfeature.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qplacebusinessfeature.h" -#include "qplacebusinessfeature_p.h" - -QT_USE_NAMESPACE - -QPlaceBusinessFeaturePrivate::QPlaceBusinessFeaturePrivate() : QSharedData() -{ -} - -QPlaceBusinessFeaturePrivate::QPlaceBusinessFeaturePrivate(const QPlaceBusinessFeaturePrivate &other) - : QSharedData() -{ - this->value = other.value; - this->key = other.key; - this->label = other.label; -} - -QPlaceBusinessFeaturePrivate::~QPlaceBusinessFeaturePrivate() -{ -} - -bool QPlaceBusinessFeaturePrivate::operator==(const QPlaceBusinessFeaturePrivate &other) const -{ - return ( - this->value == other.value - && this->key == other.key - && this->label == other.label - ); -} - -/*! - \class QPlaceBusinessFeature - - \inmodule QPlaces - - \brief The QPlaceBusinessFeature class represents a business services object. - - Each QPlaceBusinessFeature represents a business service object with a number of attributes - such as key etc. -*/ - - -/*! - Constructs an new "empty" business feature object. -*/ -QPlaceBusinessFeature::QPlaceBusinessFeature() - : d(new QPlaceBusinessFeaturePrivate) -{ -} - -/*! - Constructs a copy of \a other -*/ -QPlaceBusinessFeature::QPlaceBusinessFeature(const QPlaceBusinessFeature &other) - :d(other.d) -{ -} - -/*! - Destructor. -*/ -QPlaceBusinessFeature::~QPlaceBusinessFeature() -{ -} - -QPlaceBusinessFeature &QPlaceBusinessFeature::operator =(const QPlaceBusinessFeature &other) { - d = other.d; - return *this; -} - -bool QPlaceBusinessFeature::operator==(const QPlaceBusinessFeature &other) const -{ - return (*(d.constData()) == *(other.d.constData())); -} - -/*! - Returns key. -*/ -QString QPlaceBusinessFeature::key() const -{ - return d->key; -} - -/*! - Sets key. -*/ -void QPlaceBusinessFeature::setKey(const QString &data) -{ - d->key = data; -} - -/*! - Returns label. -*/ -QString QPlaceBusinessFeature::label() const -{ - return d->label; -} - -/*! - Sets label. -*/ -void QPlaceBusinessFeature::setLabel(const QString &data) -{ - d->label = data; -} - -/*! - Returns value. -*/ -QString QPlaceBusinessFeature::value() const -{ - return d->value; -} - -/*! - Sets value. -*/ -void QPlaceBusinessFeature::setValue(const QString &data) -{ - d->value = data; -} diff --git a/src/location/places/qplacebusinessfeature.h b/src/location/places/qplacebusinessfeature.h deleted file mode 100644 index 78da218e..00000000 --- a/src/location/places/qplacebusinessfeature.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLACEBUSINESSFEATURE_H -#define QPLACEBUSINESSFEATURE_H - -#include <QSharedDataPointer> -#include <QString> -#include "qmobilityglobal.h" - -QT_BEGIN_HEADER - -class QPlaceBusinessFeaturePrivate; - -class Q_LOCATION_EXPORT QPlaceBusinessFeature -{ -public: - QPlaceBusinessFeature(); - QPlaceBusinessFeature(const QPlaceBusinessFeature &other); - - virtual ~QPlaceBusinessFeature(); - - QPlaceBusinessFeature &operator=(const QPlaceBusinessFeature &other); - - bool operator==(const QPlaceBusinessFeature &other) const; - bool operator!=(const QPlaceBusinessFeature &other) const { - return !(other == *this); - } - - QString key() const; - void setKey(const QString &data); - QString label() const; - void setLabel(const QString &data); - QString value() const; - void setValue(const QString &data); - -private: - QSharedDataPointer<QPlaceBusinessFeaturePrivate> d; -}; - -QT_END_NAMESPACE - -#endif // QPLACEBUSINESSFEATURE_H diff --git a/src/location/places/qplacebusinessfeature_p.h b/src/location/places/qplacebusinessfeature_p.h deleted file mode 100644 index 008a58bb..00000000 --- a/src/location/places/qplacebusinessfeature_p.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLACEBUSINESSFEATURE_P_H -#define QPLACEBUSINESSFEATURE_P_H - -#include <QString> -#include <QSharedData> - -#include "qplacebusinessfeature.h" - -QT_BEGIN_NAMESPACE - -class QPlaceBusinessFeaturePrivate : public QSharedData -{ -public: - QPlaceBusinessFeaturePrivate(); - QPlaceBusinessFeaturePrivate(const QPlaceBusinessFeaturePrivate &other); - - ~QPlaceBusinessFeaturePrivate(); - - bool operator==(const QPlaceBusinessFeaturePrivate &other) const; - - QString key; - QString label; - QString value; -}; - -QT_END_NAMESPACE - -#endif // QPLACEBUSINESSFEATURE_P_H diff --git a/src/location/places/qplacebusinessinformation.cpp b/src/location/places/qplacebusinessinformation.cpp deleted file mode 100644 index c6d2a1ce..00000000 --- a/src/location/places/qplacebusinessinformation.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qplacebusinessinformation.h" -#include "qplacebusinessinformation_p.h" - -QT_USE_NAMESPACE - -QPlaceBusinessInformationPrivate::QPlaceBusinessInformationPrivate() : QSharedData() -{ -} - -QPlaceBusinessInformationPrivate::QPlaceBusinessInformationPrivate(const QPlaceBusinessInformationPrivate &other) - : QSharedData() -{ - this->additionalData = other.additionalData; - this->annualClosings = other.annualClosings; - this->openingHours = other.openingHours; - this->features = other.features; - this->annualClosingNote = other.annualClosingNote; - this->openingNote = other.openingNote; - this->paymentMethods = other.paymentMethods; -} - -QPlaceBusinessInformationPrivate::~QPlaceBusinessInformationPrivate() -{ -} - -bool QPlaceBusinessInformationPrivate::operator==(const QPlaceBusinessInformationPrivate &other) const -{ - return ( - this->additionalData == other.additionalData - && this->annualClosings == other.annualClosings - && this->openingHours == other.openingHours - && this->features == other.features - && this->annualClosingNote == other.annualClosingNote - && this->openingNote == other.openingNote - && this->paymentMethods == other.paymentMethods - ); -} - -/*! - \class QPlaceBusinessInformation - - \inmodule QPlaces - - \brief The QPlaceBusinessInformation class represents a business information object. - - Each QPlaceBusinessInformation represents a business information object with a number of attributes - such as opening hours, payment methods etc. Each QPlaceBusinessInformation is associated with place. - - Business info objects are read-only, e.g. user of API might get business info object - associated to specific place but can not edit its content. User might also create new - business info object and add it to place. - - QPlaceBusinessInformation is an in memory representation of a business info object. -*/ - - -/* - Constructs an new "empty" business info object. -*/ -QPlaceBusinessInformation::QPlaceBusinessInformation() - : d(new QPlaceBusinessInformationPrivate) -{ -} - -/*! - Constructs a copy of \a other -*/ -QPlaceBusinessInformation::QPlaceBusinessInformation(const QPlaceBusinessInformation &other) - :d(other.d) -{ -} - -/*! - Destructor. -*/ -QPlaceBusinessInformation::~QPlaceBusinessInformation() -{ -} - -QPlaceBusinessInformation &QPlaceBusinessInformation::operator =(const QPlaceBusinessInformation &other) { - d = other.d; - return *this; -} - -bool QPlaceBusinessInformation::operator==(const QPlaceBusinessInformation &other) const -{ - return (*(d.constData()) == *(other.d.constData())); -} - -/*! - Returns additional data. -*/ -QVariantHash QPlaceBusinessInformation::additionalData() const -{ - return d->additionalData; -} - -/*! - Sets additional data. -*/ -void QPlaceBusinessInformation::setAdditionalData(const QVariantHash &data) -{ - d->additionalData = data; -} - -/*! - Returns annual closing. -*/ -QList<QPlacePeriod> QPlaceBusinessInformation::annualClosings() const -{ - return d->annualClosings; -} - -/*! - Sets annual closing. -*/ -void QPlaceBusinessInformation::setAnnualClosings(const QList<QPlacePeriod> &data) -{ - d->annualClosings = data; -} - -/*! - Returns opening hours. -*/ -QList<QPlaceWeekdayHours> QPlaceBusinessInformation::openingHours() const -{ - return d->openingHours; -} - -/*! - Sets opening hours. -*/ -void QPlaceBusinessInformation::setOpeningHours(const QList<QPlaceWeekdayHours> &data) -{ - d->openingHours = data; -} - -/*! - Returns annual closing note. -*/ -QString QPlaceBusinessInformation::annualClosingNote() const -{ - return d->annualClosingNote; -} - -/*! - Sets annual closing note. -*/ -void QPlaceBusinessInformation::setAnnualClosingNote(const QString &data) -{ - d->annualClosingNote = data; -} - -/*! - Returns features. -*/ -QList<QPlaceBusinessFeature> QPlaceBusinessInformation::features() const -{ - return d->features; -} - -/*! - Sets features. -*/ -void QPlaceBusinessInformation::setFeatures(const QList<QPlaceBusinessFeature> &data) -{ - d->features = data; -} - -/*! - Returns opening note. -*/ -QString QPlaceBusinessInformation::openingNote() const -{ - return d->openingNote; -} - -/*! - Sets opening note. -*/ -void QPlaceBusinessInformation::setOpeningNote(const QString &data) -{ - d->openingNote = data; -} - -/*! - Returns payment methods. -*/ -QStringList QPlaceBusinessInformation::paymentMethods() const -{ - return d->paymentMethods; -} - -/*! - Sets paymant methods. -*/ -void QPlaceBusinessInformation::setPaymentMethods(const QStringList &data) -{ - d->paymentMethods = data; -} diff --git a/src/location/places/qplacebusinessinformation.h b/src/location/places/qplacebusinessinformation.h deleted file mode 100644 index a6cf853b..00000000 --- a/src/location/places/qplacebusinessinformation.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLACEBUSINESSINFORMATION_H -#define QPLACEBUSINESSINFORMATION_H - -#include <QSharedDataPointer> -#include <QString> -#include <QStringList> -#include <QList> -#include <QVariant> - -#include "qplacebusinessfeature.h" -#include "qplaceperiod.h" -#include "qplaceweekdayhours.h" - -QT_BEGIN_NAMESPACE - -class QPlaceBusinessInformationPrivate; - -class Q_LOCATION_EXPORT QPlaceBusinessInformation -{ -public: - QPlaceBusinessInformation(); - QPlaceBusinessInformation(const QPlaceBusinessInformation &other); - - virtual ~QPlaceBusinessInformation(); - - QPlaceBusinessInformation &operator=(const QPlaceBusinessInformation &other); - - bool operator==(const QPlaceBusinessInformation &other) const; - bool operator!=(const QPlaceBusinessInformation &other) const { - return !(other == *this); - } - - QVariantHash additionalData() const; - void setAdditionalData(const QVariantHash &data); - QList<QPlacePeriod> annualClosings() const; - void setAnnualClosings(const QList<QPlacePeriod> &data); - QList<QPlaceWeekdayHours> openingHours() const; - void setOpeningHours(const QList<QPlaceWeekdayHours> &data); - QString annualClosingNote() const; - void setAnnualClosingNote(const QString &data); - QList<QPlaceBusinessFeature> features() const; - void setFeatures(const QList<QPlaceBusinessFeature> &data); - QString openingNote() const; - void setOpeningNote(const QString &data); - QStringList paymentMethods() const; - void setPaymentMethods(const QStringList &data); - -private: - QSharedDataPointer<QPlaceBusinessInformationPrivate> d; -}; - -QT_END_NAMESPACE - - -#endif // QPLACEBUSINESSINFORMATION_H diff --git a/src/location/places/qplacebusinessinformation_p.h b/src/location/places/qplacebusinessinformation_p.h deleted file mode 100644 index 8baee002..00000000 --- a/src/location/places/qplacebusinessinformation_p.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLACEBUSINESSINFORMATION_P_H -#define QPLACEBUSINESSINFORMATION_P_H - -#include <QSharedData> - -#include "qplacebusinessinformation.h" - -QT_BEGIN_NAMESPACE - -class QPlaceBusinessInformationPrivate : public QSharedData -{ -public: - QPlaceBusinessInformationPrivate(); - QPlaceBusinessInformationPrivate(const QPlaceBusinessInformationPrivate &other); - - ~QPlaceBusinessInformationPrivate(); - - bool operator==(const QPlaceBusinessInformationPrivate &other) const; - - QVariantHash additionalData; - QList<QPlacePeriod> annualClosings; - QList<QPlaceWeekdayHours> openingHours; - QList<QPlaceBusinessFeature> features; - QString annualClosingNote; - QString openingNote; - QStringList paymentMethods; -}; - -QT_END_NAMESPACE - -#endif // QPLACEBUSINESSINFORMATION_P_H diff --git a/src/location/places/qplaceweekdayhours.cpp b/src/location/places/qplaceweekdayhours.cpp deleted file mode 100644 index 2662d91f..00000000 --- a/src/location/places/qplaceweekdayhours.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qplaceweekdayhours.h" -#include "qplaceweekdayhours_p.h" - -QT_USE_NAMESPACE - -QPlaceWeekdayHoursPrivate::QPlaceWeekdayHoursPrivate() - : QSharedData(), - weekday(Qt::Monday) -{ -} - -QPlaceWeekdayHoursPrivate::QPlaceWeekdayHoursPrivate(const QPlaceWeekdayHoursPrivate &other) - : QSharedData() -{ - this->period = other.period; - this->weekday = other.weekday; -} - -QPlaceWeekdayHoursPrivate::~QPlaceWeekdayHoursPrivate() -{ -} - -bool QPlaceWeekdayHoursPrivate::operator==(const QPlaceWeekdayHoursPrivate &other) const -{ - return ( - this->period == other.period - && this->weekday == other.weekday - ); -} - -/*! - \class QPlaces::QWeekdayHours - - \inmodule QPlaces - - \brief The QWeekdayHours class represents a day of week object. - It might contains hours information and day of the week that place is open. -*/ - -/*! - Constructs an new weekday object. -*/ -QPlaceWeekdayHours::QPlaceWeekdayHours() - : d(new QPlaceWeekdayHoursPrivate) -{ -} - -/*! - Constructs a copy of \a other -*/ -QPlaceWeekdayHours::QPlaceWeekdayHours(const QPlaceWeekdayHours &other) - :d(other.d) -{ -} - -/*! - Destructor. -*/ -QPlaceWeekdayHours::~QPlaceWeekdayHours() -{ -} - -QPlaceWeekdayHours &QPlaceWeekdayHours::operator =(const QPlaceWeekdayHours &other) { - d = other.d; - return *this; -} - -bool QPlaceWeekdayHours::operator==(const QPlaceWeekdayHours &other) const -{ - return (*(d.constData()) == *(other.d.constData())); -} - -/*! - Returns period. Do not delete it. -*/ -QPlacePeriod QPlaceWeekdayHours::period() const -{ - return d->period; -} -/*! - Sets period. -*/ -void QPlaceWeekdayHours::setPeriod(const QPlacePeriod &period) -{ - d->period = period; -} - -/*! - Returns day of the week. -*/ -Qt::DayOfWeek QPlaceWeekdayHours::weekday() const -{ - return d->weekday; -} - -/*! - Sets weekday. -*/ -void QPlaceWeekdayHours::setWeekday(const Qt::DayOfWeek &weekday) -{ - d->weekday = weekday; -} - diff --git a/src/location/places/qplaceweekdayhours.h b/src/location/places/qplaceweekdayhours.h deleted file mode 100644 index d7ece673..00000000 --- a/src/location/places/qplaceweekdayhours.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLACEWEEKDAYHOURS_H -#define QPLACEWEEKDAYHOURS_H - -#include <QSharedDataPointer> -#include "qmobilityglobal.h" -#include "qplaceperiod.h" - -QT_BEGIN_NAMESPACE - -class QPlaceWeekdayHoursPrivate; - -class Q_LOCATION_EXPORT QPlaceWeekdayHours -{ -public: - QPlaceWeekdayHours(); - QPlaceWeekdayHours(const QPlaceWeekdayHours &other); - - virtual ~QPlaceWeekdayHours(); - - QPlaceWeekdayHours &operator=(const QPlaceWeekdayHours &other); - - bool operator==(const QPlaceWeekdayHours &other) const; - bool operator!=(const QPlaceWeekdayHours &other) const { - return !(other == *this); - } - - QPlacePeriod period() const; - void setPeriod(const QPlacePeriod &period); - Qt::DayOfWeek weekday() const; - void setWeekday(const Qt::DayOfWeek &weekday); - -private: - QSharedDataPointer<QPlaceWeekdayHoursPrivate> d; -}; - -QT_END_NAMESPACE - -#endif // QPLACEWEEKDAYHOURS_H diff --git a/src/location/places/qplaceweekdayhours_p.h b/src/location/places/qplaceweekdayhours_p.h deleted file mode 100644 index cfde2a1b..00000000 --- a/src/location/places/qplaceweekdayhours_p.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPLACEWEEKDAYHOURS_P_H -#define QPLACEWEEKDAYHOURS_P_H - -#include <QSharedData> - -#include "qplaceweekdayhours.h" - -QT_BEGIN_NAMESPACE - -class QPlaceWeekdayHoursPrivate : public QSharedData -{ -public: - QPlaceWeekdayHoursPrivate(); - QPlaceWeekdayHoursPrivate(const QPlaceWeekdayHoursPrivate &other); - - ~QPlaceWeekdayHoursPrivate(); - - bool operator==(const QPlaceWeekdayHoursPrivate &other) const; - - QPlacePeriod period; - Qt::DayOfWeek weekday; -}; - -QT_END_NAMESPACE - -#endif // QPLACEWEEKDAYHOURS_P_H diff --git a/src/location/qgeoplace.cpp b/src/location/qgeoplace.cpp index 28ac853e..2325491a 100644 --- a/src/location/qgeoplace.cpp +++ b/src/location/qgeoplace.cpp @@ -252,23 +252,6 @@ void QGeoPlace::setAdditionalData(const QVariantHash &data) d->additionalData = data; } -/*! - Returns business info. -*/ -QPlaceBusinessInformation QGeoPlace::businessInformation() const -{ - Q_D(const QGeoPlace); - return d->businessInfo; -} - -/*! - Sets business info. -*/ -void QGeoPlace::setBusinessInformation(const QPlaceBusinessInformation &business) -{ - Q_D(QGeoPlace); - d->businessInfo = business; -} /*! Returns categories. @@ -676,7 +659,6 @@ QGeoPlacePrivate::QGeoPlacePrivate(const QGeoPlacePrivate &other) coordinate(other.coordinate), address(other.address), additionalData(other.additionalData), - businessInfo(other.businessInfo), categories(other.categories), descriptions(other.descriptions), location(other.location), @@ -721,7 +703,6 @@ bool QGeoPlacePrivate::operator== (const QGeoPlacePrivate &other) const qDebug() << "coordinate:" << (coordinate == other.coordinate); qDebug() << "address:" << (address == other.address); qDebug() << "additionalData: " << (additionalData == other.additionalData); - qDebug() << "businessInfo: " << (businessInfo == other.businessInfo); qDebug() << "categories: " << (categories == other.categories); qDebug() << "descriptions: " << (descriptions == other.descriptions); qDebug() << "location:" << (location == other.location); @@ -748,7 +729,6 @@ bool QGeoPlacePrivate::operator== (const QGeoPlacePrivate &other) const && coordinate == other.coordinate && address == other.address && additionalData == other.additionalData - && businessInfo == other.businessInfo && categories == other.categories && descriptions == other.descriptions && location == other.location diff --git a/src/location/qgeoplace.h b/src/location/qgeoplace.h index 8e9d1985..9d11250a 100644 --- a/src/location/qgeoplace.h +++ b/src/location/qgeoplace.h @@ -50,7 +50,6 @@ #include "qgeoboundingbox.h" #include "qgeocoordinate.h" #include "qgeolocation.h" -#include "qplacebusinessinformation.h" #include "qplacecategory.h" #include "qplacedescription.h" #include "qplacerating.h" @@ -94,8 +93,6 @@ public: QVariantHash additionalData() const; void setAdditionalData(const QVariantHash &data); - QPlaceBusinessInformation businessInformation() const; - void setBusinessInformation(const QPlaceBusinessInformation &business); QList<QPlaceCategory> categories() const; void setCategories(const QList<QPlaceCategory> &categories); QList<QPlaceDescription> descriptions() const; diff --git a/src/location/qgeoplace_p.h b/src/location/qgeoplace_p.h index dbff1d0f..6aabebc8 100644 --- a/src/location/qgeoplace_p.h +++ b/src/location/qgeoplace_p.h @@ -87,7 +87,6 @@ public: QGeoAddress address; QVariantHash additionalData; - QPlaceBusinessInformation businessInfo; QList<QPlaceCategory> categories; QList<QPlaceDescription> descriptions; QGeoLocation location; diff --git a/src/plugins/geoservices/nokia/places/qplacejsondetailsparser.cpp b/src/plugins/geoservices/nokia/places/qplacejsondetailsparser.cpp index 777ec41f..aa3f4afc 100644 --- a/src/plugins/geoservices/nokia/places/qplacejsondetailsparser.cpp +++ b/src/plugins/geoservices/nokia/places/qplacejsondetailsparser.cpp @@ -59,11 +59,9 @@ #include <qplacecategory.h> #include <qplacedescription.h> #include <qplacerating.h> -#include <qplacebusinessinformation.h> #include <qgeolocation.h> #include <qplacemediaobject.h> #include <qplaceperiod.h> -#include <qplaceweekdayhours.h> #include <qplacesupplier.h> #include "qplacejsoncategoriesparser.h" #include "qplacesuppliersrepository.h" @@ -866,12 +864,9 @@ void QPlaceJSonDetailsParser::processAdContentPaymentMethods(const QScriptValue } } if (list.count()) { - QPlaceBusinessInformation busInfo = targetPlace->businessInformation(); - busInfo.setPaymentMethods(list); - targetPlace->setBusinessInformation(busInfo); QPlaceAttribute paymentMethods; paymentMethods.setText(list.join(",")); - targetPlace->insertExtendedAttribute("paymentMethods", paymentMethods); + targetPlace->insertExtendedAttribute(QPlaceAttribute::PaymentMethods, paymentMethods); } } } @@ -914,9 +909,10 @@ void QPlaceJSonDetailsParser::processAdContentClosingsNotes(const QScriptValue & if (it.name() != "length") { QString obj = processAdContentClosingsNote(it.value()); if (!obj.isEmpty()) { - QPlaceBusinessInformation busInfo = targetPlace->businessInformation(); - busInfo.setAnnualClosingNote(obj); - targetPlace->setBusinessInformation(busInfo); + //The JSON data specification defines closing notes + //but our API doesn't expose this so we + //parse and skip assignment + //! @todo only one is used break; } @@ -925,9 +921,9 @@ void QPlaceJSonDetailsParser::processAdContentClosingsNotes(const QScriptValue & } else { QString obj = processAdContentClosingsNote(value); if (!obj.isEmpty()) { - QPlaceBusinessInformation busInfo = targetPlace->businessInformation(); - busInfo.setAnnualClosingNote(obj); - targetPlace->setBusinessInformation(busInfo); + //The JSON data specification defines closing notes + //but our API doesn't expose this so we + //parse and skip assignment } } } @@ -947,55 +943,46 @@ void QPlaceJSonDetailsParser::processAdContentOpeningHours(const QScriptValue &c { QScriptValue value = content.property(place_adcontent_hours_open_hours_element); if (value.isValid()) { - QList<QPlaceWeekdayHours> list; if (value.isArray()) { QScriptValueIterator it(value); while (it.hasNext()) { it.next(); // array contains count as last element if (it.name() != "length") { - QPlaceWeekdayHours *obj = processAdContentOpeningHoursElement(it.value()); - if (obj) { - list.append(*obj); - delete obj; - obj = NULL; - } + processAdContentOpeningHoursElement(it.value()); + //The JSON data specification defines + //structured opening hour elements + //but our API doesn't expose this so we + //parse and skip assignment } } } else { - QPlaceWeekdayHours *obj = processAdContentOpeningHoursElement(value); - if (obj) { - list.append(*obj); - delete obj; - obj = NULL; - } + processAdContentOpeningHoursElement(value); + //The JSON data specification defines + //structured opening hour elements + //but our API doesn't expose this so we + //parse and skip assignment } - QPlaceBusinessInformation busInfo = targetPlace->businessInformation(); - busInfo.setOpeningHours(list); - targetPlace->setBusinessInformation(busInfo); } } -QPlaceWeekdayHours *QPlaceJSonDetailsParser::processAdContentOpeningHoursElement(const QScriptValue &content) +void QPlaceJSonDetailsParser::processAdContentOpeningHoursElement(const QScriptValue &content) { - QPlaceWeekdayHours *openH = new QPlaceWeekdayHours(); + //The JSON data specification defines + //structured opening hour elements + //but our API doesn't expose this so we + //parse but do nothing else + QScriptValue value = content.property(place_adcontent_hours_open_day_element); if (value.isValid() && !value.toString().isEmpty()) { QString day = value.toString(); if (place_premiumcontent_content_monday == day) { - openH->setWeekday(Qt::Monday); } else if (place_premiumcontent_content_tuesday == day) { - openH->setWeekday(Qt::Tuesday); } else if (place_premiumcontent_content_wednesday == day) { - openH->setWeekday(Qt::Wednesday); } else if (place_premiumcontent_content_thursday == day) { - openH->setWeekday(Qt::Thursday); } else if (place_premiumcontent_content_friday == day) { - openH->setWeekday(Qt::Friday); } else if (place_premiumcontent_content_saturday == day) { - openH->setWeekday(Qt::Saturday); } else if (place_premiumcontent_content_sunday == day) { - openH->setWeekday(Qt::Sunday); } } QTime start, end; @@ -1007,16 +994,7 @@ QPlaceWeekdayHours *QPlaceJSonDetailsParser::processAdContentOpeningHoursElement if (value.isValid() && !value.toString().isEmpty()) { end = QTime::fromString(value.toString(),"hh:mm"); } - - QTime startTime; - startTime.setHMS(start.hour(), start.minute(), 0); - QTime endTime; - endTime.setHMS(end.hour(), end.minute(), 0); - QPlacePeriod period; - period.setStartTime(startTime); - period.setEndTime(endTime); - openH->setPeriod(period); - return openH; + return; } void QPlaceJSonDetailsParser::processAdContentOpeningNotes(const QScriptValue &content, QGeoPlace*targetPlace) @@ -1031,9 +1009,9 @@ void QPlaceJSonDetailsParser::processAdContentOpeningNotes(const QScriptValue &c if (it.name() != "length") { QString obj = processAdContentOpeningNote(it.value()); if (!obj.isEmpty()) { - QPlaceBusinessInformation busInfo = targetPlace->businessInformation(); - busInfo.setOpeningNote(obj); - targetPlace->setBusinessInformation(busInfo); + QPlaceAttribute openingNote; + openingNote.setText(obj); + targetPlace->insertExtendedAttribute(QPlaceAttribute::OpeningNote, openingNote); //! @todo only one is used break; } @@ -1042,9 +1020,9 @@ void QPlaceJSonDetailsParser::processAdContentOpeningNotes(const QScriptValue &c } else { QString obj = processAdContentOpeningNote(value); if (!obj.isEmpty()) { - QPlaceBusinessInformation busInfo = targetPlace->businessInformation(); - busInfo.setOpeningNote(obj); - targetPlace->setBusinessInformation(busInfo); + QPlaceAttribute openingNote; + openingNote.setText(obj); + targetPlace->insertExtendedAttribute(QPlaceAttribute::OpeningNote, openingNote); } } } diff --git a/src/plugins/geoservices/nokia/places/qplacejsondetailsparser.h b/src/plugins/geoservices/nokia/places/qplacejsondetailsparser.h index 8c255827..bc09f568 100644 --- a/src/plugins/geoservices/nokia/places/qplacejsondetailsparser.h +++ b/src/plugins/geoservices/nokia/places/qplacejsondetailsparser.h @@ -106,7 +106,7 @@ private: static void processAdContentClosingsNotes(const QScriptValue &content, QGeoPlace *targetPlace); static QString processAdContentClosingsNote(const QScriptValue &content); static void processAdContentOpeningHours(const QScriptValue &content, QGeoPlace *targetPlace); - static QPlaceWeekdayHours *processAdContentOpeningHoursElement(const QScriptValue &content); + static void processAdContentOpeningHoursElement(const QScriptValue &content); static void processAdContentOpeningNotes(const QScriptValue &content, QGeoPlace *targetPlace); static QString processAdContentOpeningNote(const QScriptValue &content); diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index d248ff8b..616cbfad 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -16,16 +16,13 @@ SUBDIRS += geotestplugin \ qgeoplace \ qgeocodereply \ qgeocodingmanager \ - qplacebusinessfeature \ qplacecategory \ qplacedescription \ qplacemanager \ qplacemediaobject \ - qplaceperiod \ qplacerequest \ qplacerating \ qplacereview \ qplacesearchrequest \ qplacesupplier \ - qplaceweekdayhours \ declarative diff --git a/tests/auto/qgeoplace/tst_qgeoplace.cpp b/tests/auto/qgeoplace/tst_qgeoplace.cpp index ce5083c4..8099c8c9 100644 --- a/tests/auto/qgeoplace/tst_qgeoplace.cpp +++ b/tests/auto/qgeoplace/tst_qgeoplace.cpp @@ -17,7 +17,6 @@ public: private Q_SLOTS: void constructorTest(); void additionalDataTest(); - void businessInformationTest(); void categoriesTest(); void descriptionsTest(); void detailsFetchedTest(); @@ -49,9 +48,10 @@ void tst_QGeoPlace::constructorTest() { QGeoPlace testObj; testObj.setPlaceId("testId"); - QPlaceBusinessInformation obj; - obj.setOpeningNote("10"); - testObj.setBusinessInformation(obj); + QPlaceAttribute paymentMethods; + paymentMethods.setLabel("Payment methods"); + paymentMethods.setText("Visa"); + testObj.insertExtendedAttribute(QPlaceAttribute::PaymentMethods, paymentMethods); QGeoLocation loc; loc.setCoordinate(QGeoCoordinate(10,20)); testObj.setLocation(loc); @@ -137,16 +137,6 @@ void tst_QGeoPlace::locationTest() QVERIFY2(testObj.location() == obj, "Wrong value returned"); } -void tst_QGeoPlace::businessInformationTest() -{ - QGeoPlace testObj; - QVERIFY2(testObj.businessInformation() == QPlaceBusinessInformation(), "Wrong default value"); - QPlaceBusinessInformation obj; - obj.setOpeningNote("10"); - testObj.setBusinessInformation(obj); - QVERIFY2(testObj.businessInformation() == obj, "Wrong value returned"); -} - void tst_QGeoPlace::descriptionsTest() { QGeoPlace testObj; @@ -353,9 +343,10 @@ void tst_QGeoPlace::operatorsTest() { QGeoPlace testObj; testObj.setPlaceId("testId"); - QPlaceBusinessInformation obj; - obj.setOpeningNote("10"); - testObj.setBusinessInformation(obj); + QPlaceAttribute paymentMethods; + paymentMethods.setLabel("Payment methods"); + paymentMethods.setText("Visa"); + testObj.insertExtendedAttribute(QPlaceAttribute::PaymentMethods, paymentMethods); QStringList tags; tags << "1" << "2" << "3"; testObj.setTags(tags); diff --git a/tests/auto/qplacebusinessfeature/qplacebusinessfeature.pro b/tests/auto/qplacebusinessfeature/qplacebusinessfeature.pro deleted file mode 100644 index 7bb0a8a6..00000000 --- a/tests/auto/qplacebusinessfeature/qplacebusinessfeature.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE = app -CONFIG += testcase -TARGET = tst_qplacebusinessfeature - -SOURCES += tst_qplacebusinessfeature.cpp - -QT += location testlib diff --git a/tests/auto/qplacebusinessfeature/tst_qplacebusinessfeature.cpp b/tests/auto/qplacebusinessfeature/tst_qplacebusinessfeature.cpp deleted file mode 100644 index eb069be2..00000000 --- a/tests/auto/qplacebusinessfeature/tst_qplacebusinessfeature.cpp +++ /dev/null @@ -1,75 +0,0 @@ -#include <QtCore/QString> -#include <QtTest/QtTest> - -#include <qplacebusinessfeature.h> - -QT_USE_NAMESPACE - -class tst_QPlaceBusinessFeature : public QObject -{ - Q_OBJECT - -public: - tst_QPlaceBusinessFeature(); - -private Q_SLOTS: - void constructorTest(); - void keyTest(); - void labelTest(); - void valueTest(); - void operatorsTest(); -}; - -tst_QPlaceBusinessFeature::tst_QPlaceBusinessFeature() -{ -} - -void tst_QPlaceBusinessFeature::constructorTest() -{ - QPlaceBusinessFeature testObj; - Q_UNUSED(testObj); - - QPlaceBusinessFeature *testObjPtr = new QPlaceBusinessFeature(testObj); - QVERIFY2(testObjPtr != NULL, "Copy constructor - null"); - QVERIFY2(*testObjPtr == testObj, "Copy constructor - compare"); - delete testObjPtr; -} - -void tst_QPlaceBusinessFeature::keyTest() -{ - QPlaceBusinessFeature testObj; - QVERIFY2(testObj.key() == QString(), "Wrong default value"); - testObj.setKey("testText"); - QVERIFY2(testObj.key() == "testText", "Wrong value returned"); -} - -void tst_QPlaceBusinessFeature::labelTest() -{ - QPlaceBusinessFeature testObj; - QVERIFY2(testObj.label() == QString(), "Wrong default value"); - testObj.setLabel("testText"); - QVERIFY2(testObj.label() == "testText", "Wrong value returned"); -} - -void tst_QPlaceBusinessFeature::valueTest() -{ - QPlaceBusinessFeature testObj; - QVERIFY2(testObj.value() == QString(), "Wrong default value"); - testObj.setValue("testText"); - QVERIFY2(testObj.value() == "testText", "Wrong value returned"); -} - -void tst_QPlaceBusinessFeature::operatorsTest() -{ - QPlaceBusinessFeature testObj; - testObj.setKey("testValue"); - QPlaceBusinessFeature testObj2; - testObj2 = testObj; - QVERIFY2(testObj == testObj2, "Not copied correctly"); - testObj2.setLabel("testValue2"); - QVERIFY2(testObj != testObj2, "Object should be different"); -} - -QTEST_APPLESS_MAIN(tst_QPlaceBusinessFeature); - -#include "tst_qplacebusinessfeature.moc" diff --git a/tests/auto/qplaceweekdayhours/qplaceweekdayhours.pro b/tests/auto/qplaceweekdayhours/qplaceweekdayhours.pro deleted file mode 100644 index fb2c3240..00000000 --- a/tests/auto/qplaceweekdayhours/qplaceweekdayhours.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE = app -CONFIG += testcase -TARGET = tst_qplaceweekdayhours - -SOURCES += tst_qplaceweekdayhours.cpp - -QT += location testlib diff --git a/tests/auto/qplaceweekdayhours/tst_qplaceweekdayhours.cpp b/tests/auto/qplaceweekdayhours/tst_qplaceweekdayhours.cpp deleted file mode 100644 index 13e49305..00000000 --- a/tests/auto/qplaceweekdayhours/tst_qplaceweekdayhours.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include <QtCore/QString> -#include <QtTest/QtTest> - -#include <qplaceweekdayhours.h> - -QT_USE_NAMESPACE - -class tst_QPlaceWeekdayHours : public QObject -{ - Q_OBJECT - -public: - tst_QPlaceWeekdayHours(); - -private Q_SLOTS: - void constructorTest(); - void periodTest(); - void weekdayTest(); - void operatorsTest(); -}; - -tst_QPlaceWeekdayHours::tst_QPlaceWeekdayHours() -{ -} - -void tst_QPlaceWeekdayHours::constructorTest() -{ - QPlaceWeekdayHours testObj; - testObj.setWeekday(Qt::Wednesday); - QPlaceWeekdayHours *testObjPtr = new QPlaceWeekdayHours(testObj); - QVERIFY2(testObjPtr != NULL, "Copy constructor - null"); - QVERIFY2(*testObjPtr == testObj, "Copy constructor - start time"); - delete testObjPtr; -} - -void tst_QPlaceWeekdayHours::weekdayTest() -{ - QPlaceWeekdayHours testObj; - QVERIFY2(testObj.weekday() == Qt::Monday, "Wrong default value"); - testObj.setWeekday(Qt::Sunday); - QVERIFY2(testObj.weekday() == Qt::Sunday, "Wrong value returned"); -} - -void tst_QPlaceWeekdayHours::periodTest() -{ - QPlaceWeekdayHours testObj; - QVERIFY2(testObj.period() == QPlacePeriod(), "Wrong default value"); - QTime time = QTime::currentTime(); - QPlacePeriod period; - period.setStartTime(time); - testObj.setPeriod(period); - QVERIFY2(testObj.period().startTime() == time, "Wrong value returned"); -} - -void tst_QPlaceWeekdayHours::operatorsTest() -{ - QPlaceWeekdayHours testObj; - QTime time = QTime::currentTime(); - testObj.setWeekday(Qt::Sunday); - QPlaceWeekdayHours testObj2; - testObj2 = testObj; - QVERIFY2(testObj == testObj2, "Not copied correctly"); - testObj.setWeekday(Qt::Thursday); - QVERIFY2(testObj != testObj2, "Object should be different"); -} - -QTEST_APPLESS_MAIN(tst_QPlaceWeekdayHours); - -#include "tst_qplaceweekdayhours.moc" |