summaryrefslogtreecommitdiff
path: root/src/imports
diff options
context:
space:
mode:
authorabcd <qt-info@nokia.com>2011-07-25 19:05:43 +1000
committerAaron McCarthy <aaron.mccarthy@nokia.com>2011-07-26 06:50:46 +0200
commit6644df4c5322dde974a63ba55b8b703394e8d352 (patch)
tree75cdda9f6c0e6ff56fa3b70cea73c1b8ceac5f81 /src/imports
parentbe08155db25f2a9a04adfbd3fd1c6c156aaf5139 (diff)
downloadqtlocation-6644df4c5322dde974a63ba55b8b703394e8d352.tar.gz
Remove alternative labels
Currently there is uncertainty on how alternative labels should be handled so remove for now. For most use cases this won't be needed anyway. If necessary we can add these in at a later point in time. Change-Id: I24e719bd394d60787f12234ddbe8e9aaa683d53c Reviewed-on: http://codereview.qt.nokia.com/2097 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/location/declarativeplaces/declarativeplaces.pri2
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativealternativevalue.cpp148
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativealternativevalue_p.h76
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativecategory.cpp76
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativecategory_p.h14
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplace.cpp76
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplace_p.h11
-rw-r--r--src/imports/location/location.cpp2
-rw-r--r--src/imports/location/qdeclarativegeolocation.cpp75
-rw-r--r--src/imports/location/qdeclarativegeolocation_p.h11
10 files changed, 0 insertions, 491 deletions
diff --git a/src/imports/location/declarativeplaces/declarativeplaces.pri b/src/imports/location/declarativeplaces/declarativeplaces.pri
index f39b09c9..7bdade4b 100644
--- a/src/imports/location/declarativeplaces/declarativeplaces.pri
+++ b/src/imports/location/declarativeplaces/declarativeplaces.pri
@@ -7,7 +7,6 @@ SOURCES += \
declarativeplaces/qdeclarativetextpredictionmodel.cpp \
declarativeplaces/qdeclarativesearchresultmodel.cpp \
#data
- declarativeplaces/qdeclarativealternativevalue.cpp \
declarativeplaces/qdeclarativebusinessfeature.cpp \
declarativeplaces/qdeclarativebusinessinformation.cpp \
declarativeplaces/qdeclarativecategory.cpp \
@@ -32,7 +31,6 @@ HEADERS += \
declarativeplaces/qdeclarativetextpredictionmodel_p.h \
declarativeplaces/qdeclarativesearchresultmodel_p.h \
#data
- declarativeplaces/qdeclarativealternativevalue_p.h \
declarativeplaces/qdeclarativebusinessfeature_p.h \
declarativeplaces/qdeclarativebusinessinformation_p.h \
declarativeplaces/qdeclarativecategory_p.h \
diff --git a/src/imports/location/declarativeplaces/qdeclarativealternativevalue.cpp b/src/imports/location/declarativeplaces/qdeclarativealternativevalue.cpp
deleted file mode 100644
index bac8159f..00000000
--- a/src/imports/location/declarativeplaces/qdeclarativealternativevalue.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-#include "qdeclarativealternativevalue_p.h"
-
-QT_USE_NAMESPACE
-
-/*!
- \qmlclass AlternativeValue
-
- \brief The AlternativeValue element holds another value for property.
- \inherits QObject
-
- \ingroup qml-places
-*/
-
-QDeclarativeAlternativeValue::QDeclarativeAlternativeValue(QObject* parent)
- : QObject(parent)
-{
-}
-
-QDeclarativeAlternativeValue::QDeclarativeAlternativeValue(const QPlaceAlternativeValue &value,
- QObject *parent)
- : QObject(parent),
- m_value(value)
-{
-}
-
-QDeclarativeAlternativeValue::~QDeclarativeAlternativeValue()
-{
-}
-
-void QDeclarativeAlternativeValue::setValueObject(const QPlaceAlternativeValue &value)
-{
- QPlaceAlternativeValue previous = m_value;
- m_value = value;
-
- if (previous.key() != m_value.key()) {
- emit keyChanged();
- }
- if (previous.language() != m_value.language()) {
- emit languageChanged();
- }
- if (previous.semantics() != m_value.semantics()) {
- emit semanticsChanged();
- }
- if (previous.type() != m_value.type()) {
- emit typeChanged();
- }
- if (previous.value() != m_value.value()) {
- emit valueChanged();
- }
-}
-
-QPlaceAlternativeValue QDeclarativeAlternativeValue::valueObject() const
-{
- return m_value;
-}
-
-/*!
- \qmlproperty string AlternativeValue::key
-
- This property holds key description.
-*/
-
-void QDeclarativeAlternativeValue::setKey(const QString &key)
-{
- if (m_value.key() != key) {
- m_value.setKey(key);
- emit keyChanged();
- }
-}
-
-QString QDeclarativeAlternativeValue::key() const
-{
- return m_value.key();
-}
-
-/*!
- \qmlproperty string AlternativeValue::language
-
- This property holds language description.
-*/
-
-void QDeclarativeAlternativeValue::setLanguage(const QString &language)
-{
- if (m_value.language() != language) {
- m_value.setLanguage(language);
- emit languageChanged();
- }
-}
-
-QString QDeclarativeAlternativeValue::language() const
-{
- return m_value.language();
-}
-
-/*!
- \qmlproperty string AlternativeValue::semantics
-
- This property holds semantics.
-*/
-void QDeclarativeAlternativeValue::setSemantics(const QDeclarativeAlternativeValue::TextSemantics &semantics)
-{
- if (m_value.semantics() != (QPlaceAlternativeValue::TextSemantics)semantics) {
- m_value.setSemantics((QPlaceAlternativeValue::TextSemantics)semantics);
- emit semanticsChanged();
- }
-}
-
-QDeclarativeAlternativeValue::TextSemantics QDeclarativeAlternativeValue::semantics() const
-{
- return (QDeclarativeAlternativeValue::TextSemantics) m_value.semantics();
-}
-
-/*!
- \qmlproperty string AlternativeValue::type
-
- This property holds type.
-*/
-void QDeclarativeAlternativeValue::setType(const QDeclarativeAlternativeValue::NameType &type)
-{
- if (m_value.type() != (QPlaceAlternativeValue::NameType)type) {
- m_value.setType((QPlaceAlternativeValue::NameType)type);
- emit typeChanged();
- }
-}
-
-QDeclarativeAlternativeValue::NameType QDeclarativeAlternativeValue::type() const
-{
- return (QDeclarativeAlternativeValue::NameType) m_value.type();
-}
-
-/*!
- \qmlproperty string AlternativeValue::value
-
- This property holds value.
-*/
-
-void QDeclarativeAlternativeValue::setValue(const QString &value)
-{
- if (m_value.value() != value) {
- m_value.setValue(value);
- emit valueChanged();
- }
-}
-
-QString QDeclarativeAlternativeValue::value() const
-{
- return m_value.value();
-}
diff --git a/src/imports/location/declarativeplaces/qdeclarativealternativevalue_p.h b/src/imports/location/declarativeplaces/qdeclarativealternativevalue_p.h
deleted file mode 100644
index 753dcedc..00000000
--- a/src/imports/location/declarativeplaces/qdeclarativealternativevalue_p.h
+++ /dev/null
@@ -1,76 +0,0 @@
-#ifndef QDECLARATIVEALTERNATIVEVALUE_P_H
-#define QDECLARATIVEALTERNATIVEVALUE_P_H
-
-#include <qplacealternativevalue.h>
-#include <QtDeclarative/qdeclarative.h>
-
-#include <QObject>
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeAlternativeValue : public QObject
-{
- Q_OBJECT
-
- Q_ENUMS(TextSemantics)
- Q_ENUMS(NameType)
-
- Q_PROPERTY(QString key READ key WRITE setKey NOTIFY keyChanged);
- Q_PROPERTY(QString language READ language WRITE setLanguage NOTIFY languageChanged);
- Q_PROPERTY(TextSemantics semantics READ semantics WRITE setSemantics NOTIFY semanticsChanged);
- Q_PROPERTY(NameType type READ type WRITE setType NOTIFY typeChanged);
- Q_PROPERTY(QString value READ value WRITE setValue NOTIFY valueChanged);
-
-public:
- enum TextSemantics {
- Synonim,
- Exonym,
- Unclassified
- };
-
- enum NameType {
- BaseName,
- ShortBaseName,
- Abbrevation,
- Unknown
- };
-
- explicit QDeclarativeAlternativeValue(QObject* parent = 0);
- explicit QDeclarativeAlternativeValue(const QPlaceAlternativeValue &value, QObject* parent = 0);
- ~QDeclarativeAlternativeValue();
-
- QPlaceAlternativeValue valueObject() const;
- void setValueObject(const QPlaceAlternativeValue &value);
-
- QString key() const;
- void setKey(const QString &key);
-
- QString language() const;
- void setLanguage(const QString &language);
-
- TextSemantics semantics() const;
- void setSemantics(const TextSemantics &semantics);
-
- NameType type() const;
- void setType(const NameType &type);
-
- QString value() const;
- void setValue(const QString &value);
-
-
-signals:
- void keyChanged();
- void languageChanged();
- void semanticsChanged();
- void typeChanged();
- void valueChanged();
-
-private:
- QPlaceAlternativeValue m_value;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeAlternativeValue));
-
-#endif // QDECLARATIVEALTERNATIVEVALUE_P_H
diff --git a/src/imports/location/declarativeplaces/qdeclarativecategory.cpp b/src/imports/location/declarativeplaces/qdeclarativecategory.cpp
index 5f5b6e7d..3de347a6 100644
--- a/src/imports/location/declarativeplaces/qdeclarativecategory.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativecategory.cpp
@@ -20,7 +20,6 @@ QDeclarativeCategory::QDeclarativeCategory(const QPlaceCategory &category,
: QObject(parent),
m_category(category)
{
- synchronizeAlternativeValues();
}
QDeclarativeCategory::~QDeclarativeCategory() {}
@@ -39,20 +38,10 @@ void QDeclarativeCategory::setCategory(const QPlaceCategory &category)
if (category.description() != previous.description()) {
emit descriptionChanged();
}
- if (category.alternativeNames() != previous.alternativeNames()) {
- synchronizeAlternativeValues();
- emit alternativeNamesChanged();
- }
}
QPlaceCategory QDeclarativeCategory::category()
{
- QList<QPlaceAlternativeValue> list;
- foreach (QDeclarativeAlternativeValue *value, m_alternativeValues) {
- list.append(value->valueObject());
- }
- m_category.setAlternativeNames(list);
-
return m_category;
}
@@ -112,68 +101,3 @@ QString QDeclarativeCategory::name() const
{
return m_category.name();
}
-
-/*!
- \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()
-{
- return QDeclarativeListProperty<QDeclarativeAlternativeValue>(this,
- 0, // opaque data parameter
- alternativeValue_append,
- alternativeValue_count,
- alternativeValue_at,
- alternativeValue_clear);
-}
-
-void QDeclarativeCategory::alternativeValue_append(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop,
- QDeclarativeAlternativeValue *value)
-{
- QDeclarativeCategory* object = static_cast<QDeclarativeCategory*>(prop->object);
- QDeclarativeAlternativeValue *altValue = new QDeclarativeAlternativeValue(object);
- altValue->setValueObject(value->valueObject());
- object->m_alternativeValues.append(altValue);
- QList<QPlaceAlternativeValue> list = object->m_category.alternativeNames();
- list.append(value->valueObject());
- object->m_category.setAlternativeNames(list);
- emit object->alternativeNamesChanged();
-}
-
-int QDeclarativeCategory::alternativeValue_count(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop)
-{
- return static_cast<QDeclarativeCategory*>(prop->object)->m_alternativeValues.count();
-}
-
-QDeclarativeAlternativeValue* QDeclarativeCategory::alternativeValue_at(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop,
- int index)
-{
- QDeclarativeCategory* object = static_cast<QDeclarativeCategory*>(prop->object);
- QDeclarativeAlternativeValue *res = NULL;
- if (object->m_alternativeValues.count() > index && index > -1) {
- res = object->m_alternativeValues[index];
- }
- return res;
-}
-
-void QDeclarativeCategory::alternativeValue_clear(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop)
-{
- QDeclarativeCategory* object = static_cast<QDeclarativeCategory*>(prop->object);
- qDeleteAll(object->m_alternativeValues);
- object->m_alternativeValues.clear();
- object->m_category.setAlternativeNames(QList<QPlaceAlternativeValue>());
- emit object->alternativeNamesChanged();
-}
-
-void QDeclarativeCategory::synchronizeAlternativeValues()
-{
- qDeleteAll(m_alternativeValues);
- m_alternativeValues.clear();
- foreach (QPlaceAlternativeValue value, m_category.alternativeNames()) {
- QDeclarativeAlternativeValue* declarativeValue = new QDeclarativeAlternativeValue(value, this);
- m_alternativeValues.append(declarativeValue);
- }
-}
diff --git a/src/imports/location/declarativeplaces/qdeclarativecategory_p.h b/src/imports/location/declarativeplaces/qdeclarativecategory_p.h
index a8fee94e..9e371516 100644
--- a/src/imports/location/declarativeplaces/qdeclarativecategory_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativecategory_p.h
@@ -5,7 +5,6 @@
#include <QObject>
#include <qplacecategory.h>
-#include "qdeclarativealternativevalue_p.h"
QT_BEGIN_NAMESPACE
@@ -16,7 +15,6 @@ class QDeclarativeCategory : public QObject
Q_PROPERTY(QString categoryId READ categoryId WRITE setCategoryId NOTIFY categoryIdChanged)
Q_PROPERTY(QString description READ description WRITE setDescription NOTIFY descriptionChanged)
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
- Q_PROPERTY(QDeclarativeListProperty<QDeclarativeAlternativeValue> alternativeNames READ alternativeNames NOTIFY alternativeNamesChanged)
public:
explicit QDeclarativeCategory(QObject* parent = 0);
@@ -26,13 +24,6 @@ public:
QPlaceCategory category();
void setCategory(const QPlaceCategory &category);
- QDeclarativeListProperty<QDeclarativeAlternativeValue> alternativeNames();
- static void alternativeValue_append(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop,
- QDeclarativeAlternativeValue* value);
- static int alternativeValue_count(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop);
- static QDeclarativeAlternativeValue* alternativeValue_at(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop, int index);
- static void alternativeValue_clear(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop);
-
QString categoryId() const;
void setCategoryId(const QString &catID);
QString description() const;
@@ -44,13 +35,8 @@ signals:
void categoryIdChanged();
void descriptionChanged();
void nameChanged();
- void alternativeNamesChanged();
-
-private:
- void synchronizeAlternativeValues();
private:
- QList<QDeclarativeAlternativeValue*> m_alternativeValues;
QPlaceCategory m_category;
};
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
index e7542794..7b4d09c7 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
@@ -24,7 +24,6 @@ QDeclarativePlace::QDeclarativePlace(const QGeoPlace &src,
: QObject(parent),
m_src(src)
{
- synchronizeAlternativeValues();
synchronizeCategories();
synchronizeContacts();
synchronizeDescriptions();
@@ -46,10 +45,6 @@ void QDeclarativePlace::setPlace(const QGeoPlace &src)
if (previous.additionalData() != m_src.additionalData()) {
emit additionalDataChanged();
}
- if (previous.alternativeNames() != m_src.alternativeNames()) {
- synchronizeAlternativeValues();
- emit alternativeNamesChanged();
- }
if (previous.businessInformation() != m_src.businessInformation()) {
m_businessInformation.setBusinessInformation(m_src.businessInformation());
emit businessInformationChanged();
@@ -114,11 +109,6 @@ void QDeclarativePlace::setPlace(const QGeoPlace &src)
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());
@@ -423,72 +413,6 @@ 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()
-{
- return QDeclarativeListProperty<QDeclarativeAlternativeValue>(this,
- 0, // opaque data parameter
- alternativeValue_append,
- alternativeValue_count,
- alternativeValue_at,
- alternativeValue_clear);
-}
-
-void QDeclarativePlace::alternativeValue_append(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop,
- QDeclarativeAlternativeValue *value)
-{
- QDeclarativePlace* object = static_cast<QDeclarativePlace*>(prop->object);
- QDeclarativeAlternativeValue *altValue = new QDeclarativeAlternativeValue(object);
- altValue->setValueObject(value->valueObject());
- object->m_alternativeValues.append(altValue);
- QList<QPlaceAlternativeValue> list = object->m_src.alternativeNames();
- list.append(value->valueObject());
- object->m_src.setAlternativeNames(list);
- emit object->alternativeNamesChanged();
-}
-
-int QDeclarativePlace::alternativeValue_count(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop)
-{
- return static_cast<QDeclarativePlace*>(prop->object)->m_alternativeValues.count();
-}
-
-QDeclarativeAlternativeValue* QDeclarativePlace::alternativeValue_at(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop,
- int index)
-{
- QDeclarativePlace* object = static_cast<QDeclarativePlace*>(prop->object);
- QDeclarativeAlternativeValue *res = NULL;
- if (object->m_alternativeValues.count() > index && index > -1) {
- res = object->m_alternativeValues[index];
- }
- return res;
-}
-
-void QDeclarativePlace::alternativeValue_clear(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop)
-{
- QDeclarativePlace* object = static_cast<QDeclarativePlace*>(prop->object);
- qDeleteAll(object->m_alternativeValues);
- object->m_alternativeValues.clear();
- object->m_src.setAlternativeNames(QList<QPlaceAlternativeValue>());
- emit object->alternativeNamesChanged();
-}
-
-void QDeclarativePlace::synchronizeAlternativeValues()
-{
- qDeleteAll(m_alternativeValues);
- m_alternativeValues.clear();
- foreach (QPlaceAlternativeValue value, m_src.alternativeNames()) {
- QDeclarativeAlternativeValue* declarativeValue = new QDeclarativeAlternativeValue(value, this);
- m_alternativeValues.append(declarativeValue);
- }
-}
-
-/*!
\qmlproperty QDeclarativeListProperty<QDeclarativeCategory> Place::categories
This property categories list.
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace_p.h b/src/imports/location/declarativeplaces/qdeclarativeplace_p.h
index 7bb986b9..6b50db26 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplace_p.h
+++ b/src/imports/location/declarativeplaces/qdeclarativeplace_p.h
@@ -11,7 +11,6 @@
#include "qdeclarativecontact_p.h"
#include "qdeclarativerating_p.h"
#include "qdeclarativedescription_p.h"
-#include "qdeclarativealternativevalue_p.h"
#include "qdeclarativemediapaginationlist_p.h"
#include "qdeclarativereviewpaginationlist_p.h"
@@ -22,7 +21,6 @@ class QDeclarativePlace : public QObject
Q_OBJECT
Q_PROPERTY(QVariantHash additionalData READ additionalData WRITE setAdditionalData NOTIFY additionalDataChanged);
- Q_PROPERTY(QDeclarativeListProperty<QDeclarativeAlternativeValue> alternativeNames READ alternativeNames NOTIFY alternativeNamesChanged)
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)
@@ -51,12 +49,6 @@ public:
QVariantHash additionalData() const;
void setAdditionalData(const QVariantHash &data);
- QDeclarativeListProperty<QDeclarativeAlternativeValue> alternativeNames();
- static void alternativeValue_append(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop,
- QDeclarativeAlternativeValue* value);
- static int alternativeValue_count(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop);
- static QDeclarativeAlternativeValue* alternativeValue_at(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop, int index);
- static void alternativeValue_clear(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop);
QDeclarativeListProperty<QDeclarativeCategory> categories();
static void category_append(QDeclarativeListProperty<QDeclarativeCategory> *prop,
QDeclarativeCategory* value);
@@ -110,7 +102,6 @@ public:
signals:
void additionalDataChanged();
- void alternativeNamesChanged();
void categoriesChanged();
void contactsChanged();
void descriptionsChanged();
@@ -130,14 +121,12 @@ signals:
void detailsFetchedChanged();
private:
- void synchronizeAlternativeValues();
void synchronizeCategories();
void synchronizeContacts();
void synchronizeDescriptions();
void synchronizeSuppliers();
private:
- QList<QDeclarativeAlternativeValue*> m_alternativeValues;
QList<QDeclarativeCategory*> m_categories;
QList<QDeclarativeContact*> m_contacts;
QList<QDeclarativeDescription*> m_descriptions;
diff --git a/src/imports/location/location.cpp b/src/imports/location/location.cpp
index eb46826f..02de330c 100644
--- a/src/imports/location/location.cpp
+++ b/src/imports/location/location.cpp
@@ -75,7 +75,6 @@
#include "qdeclarativegeomaneuver_p.h"
//Place includes
-#include "qdeclarativealternativevalue_p.h"
#include "qdeclarativebusinessfeature_p.h"
#include "qdeclarativebusinessinformation_p.h"
#include "qdeclarativecategory_p.h"
@@ -197,7 +196,6 @@ public:
qmlRegisterType<QDeclarativeGeoRouteSegment>(uri, 5, 0, "RouteSegment");
qmlRegisterType<QDeclarativeGeoManeuver>(uri, 5, 0, "RouteManeuver");
- qmlRegisterType<QDeclarativeAlternativeValue>(uri, 5, 0, "AlternativeValue");
qmlRegisterType<QDeclarativeBusinessFeature>(uri, 5, 0, "BusinessFeature");
qmlRegisterType<QDeclarativeBusinessInformation>(uri, 5, 0, "BusinessInformation");
qmlRegisterType<QDeclarativeCategory>(uri, 5, 0, "Category");
diff --git a/src/imports/location/qdeclarativegeolocation.cpp b/src/imports/location/qdeclarativegeolocation.cpp
index bb03035e..36389dcc 100644
--- a/src/imports/location/qdeclarativegeolocation.cpp
+++ b/src/imports/location/qdeclarativegeolocation.cpp
@@ -44,10 +44,6 @@ void QDeclarativeGeoLocation::setLocation(const QGeoLocation &src)
if (previous.additionalData() != m_src.additionalData()) {
emit additionalDataChanged();
}
- if (previous.alternativeLabels() != m_src.alternativeLabels()) {
- synchronizeAlternativeValues();
- emit alternativeLabelsChanged();
- }
if (previous.address() != m_src.address()) {
m_address.setAddress(m_src.address());
emit addressChanged();
@@ -73,11 +69,6 @@ void QDeclarativeGeoLocation::setLocation(const QGeoLocation &src)
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());
@@ -208,62 +199,6 @@ 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()
-{
- return QDeclarativeListProperty<QDeclarativeAlternativeValue>(this,
- 0, // opaque data parameter
- alternativeValue_append,
- alternativeValue_count,
- alternativeValue_at,
- alternativeValue_clear);
-}
-
-void QDeclarativeGeoLocation::alternativeValue_append(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop,
- QDeclarativeAlternativeValue *value)
-{
- QDeclarativeGeoLocation* object = static_cast<QDeclarativeGeoLocation*>(prop->object);
- QDeclarativeAlternativeValue *altValue = new QDeclarativeAlternativeValue(object);
- altValue->setValueObject(value->valueObject());
- object->m_alternativeValues.append(altValue);
- QList<QPlaceAlternativeValue> list = object->m_src.alternativeLabels();
- list.append(value->valueObject());
- object->m_src.setAlternativeLabels(list);
- emit object->alternativeLabelsChanged();
-}
-
-int QDeclarativeGeoLocation::alternativeValue_count(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop)
-{
- return static_cast<QDeclarativeGeoLocation*>(prop->object)->m_alternativeValues.count();
-}
-
-QDeclarativeAlternativeValue* QDeclarativeGeoLocation::alternativeValue_at(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop,
- int index)
-{
- QDeclarativeGeoLocation* object = static_cast<QDeclarativeGeoLocation*>(prop->object);
- QDeclarativeAlternativeValue *res = NULL;
- if (object->m_alternativeValues.count() > index && index > -1) {
- res = object->m_alternativeValues[index];
- }
- return res;
-}
-
-void QDeclarativeGeoLocation::alternativeValue_clear(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop)
-{
- QDeclarativeGeoLocation* object = static_cast<QDeclarativeGeoLocation*>(prop->object);
- qDeleteAll(object->m_alternativeValues);
- object->m_alternativeValues.clear();
- object->m_src.setAlternativeLabels(QList<QPlaceAlternativeValue>());
- emit object->alternativeLabelsChanged();
-}
-
-/*!
\qmlproperty QDeclarativeListProperty<QDeclarativeCoordinate> Location::navigationPositions
This property navigation coordinates for location.
@@ -319,16 +254,6 @@ void QDeclarativeGeoLocation::navigationPosition_clear(QDeclarativeListProperty<
emit object->navigationPositionsChanged();
}
-void QDeclarativeGeoLocation::synchronizeAlternativeValues()
-{
- qDeleteAll(m_alternativeValues);
- m_alternativeValues.clear();
- foreach (QPlaceAlternativeValue value, m_src.alternativeLabels()) {
- QDeclarativeAlternativeValue* declarativeValue = new QDeclarativeAlternativeValue(value, this);
- m_alternativeValues.append(declarativeValue);
- }
-}
-
void QDeclarativeGeoLocation::synchronizeNavigationPositions()
{
qDeleteAll(m_navigationPositions);
diff --git a/src/imports/location/qdeclarativegeolocation_p.h b/src/imports/location/qdeclarativegeolocation_p.h
index 2b1b0444..e6918d52 100644
--- a/src/imports/location/qdeclarativegeolocation_p.h
+++ b/src/imports/location/qdeclarativegeolocation_p.h
@@ -7,7 +7,6 @@
#include "qdeclarativecoordinate_p.h"
#include "qdeclarativegeoboundingbox_p.h"
#include "qdeclarativegeoaddress_p.h"
-#include "qdeclarativealternativevalue_p.h"
QT_BEGIN_NAMESPACE
@@ -16,7 +15,6 @@ class QDeclarativeGeoLocation : public QObject
Q_OBJECT
Q_PROPERTY(QVariantHash additionalData READ additionalData WRITE setAdditionalData NOTIFY additionalDataChanged);
- Q_PROPERTY(QDeclarativeListProperty<QDeclarativeAlternativeValue> alternativeLabels READ alternativeLabels NOTIFY alternativeLabelsChanged)
Q_PROPERTY(QDeclarativeGeoAddress* address READ address WRITE setAddress NOTIFY addressChanged);
Q_PROPERTY(QDeclarativeCoordinate* coordinate READ coordinate WRITE setCoordinate NOTIFY coordinateChanged);
Q_PROPERTY(QDeclarativeListProperty<QDeclarativeCoordinate> navigationPositions READ navigationPositions NOTIFY navigationPositionsChanged)
@@ -34,12 +32,6 @@ public:
QVariantHash additionalData() const;
void setAdditionalData(const QVariantHash &data);
- QDeclarativeListProperty<QDeclarativeAlternativeValue> alternativeLabels();
- static void alternativeValue_append(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop,
- QDeclarativeAlternativeValue* value);
- static int alternativeValue_count(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop);
- static QDeclarativeAlternativeValue* alternativeValue_at(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop, int index);
- static void alternativeValue_clear(QDeclarativeListProperty<QDeclarativeAlternativeValue> *prop);
QDeclarativeGeoAddress *address();
void setAddress(QDeclarativeGeoAddress *address);
QDeclarativeCoordinate *coordinate();
@@ -59,7 +51,6 @@ public:
signals:
void additionalDataChanged();
- void alternativeLabelsChanged();
void addressChanged();
void coordinateChanged();
void navigationPositionsChanged();
@@ -68,11 +59,9 @@ signals:
void viewportChanged();
private:
- void synchronizeAlternativeValues();
void synchronizeNavigationPositions();
private:
- QList<QDeclarativeAlternativeValue*> m_alternativeValues;
QDeclarativeGeoAddress m_address;
QDeclarativeCoordinate m_coordinate;
QDeclarativeGeoBoundingBox m_boundingBox;