diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2011-09-06 14:16:01 +1000 |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2011-09-07 02:30:44 +0200 |
commit | 3b55bbd1fbac94def3718133db574823948c3b01 (patch) | |
tree | 4014df9794ce0e0a9e3c92f66d04fc0a4ffdc128 | |
parent | 05545f1938c851cec656f49e43cd27aef5a648c2 (diff) | |
download | qtlocation-3b55bbd1fbac94def3718133db574823948c3b01.tar.gz |
Display all additional place properties.
Change-Id: Ie9b24929eed2c9c678ec4e53561403ced27e845f
Reviewed-on: http://codereview.qt.nokia.com/4232
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: abcd <qt_abcd1@ovi.com>
Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
-rw-r--r-- | examples/declarative/qmlplaces/SearchResultDelegate.qml | 15 | ||||
-rw-r--r-- | src/plugins/geoservices/nokia/places/qplacejsondetailsparser.cpp | 3 |
2 files changed, 15 insertions, 3 deletions
diff --git a/examples/declarative/qmlplaces/SearchResultDelegate.qml b/examples/declarative/qmlplaces/SearchResultDelegate.qml index 1d1450bb..8a8385d5 100644 --- a/examples/declarative/qmlplaces/SearchResultDelegate.qml +++ b/examples/declarative/qmlplaces/SearchResultDelegate.qml @@ -130,8 +130,19 @@ Rectangle { } } font.pixelSize: 16 + } + + Repeater { + id: extendedAttributes + model: place.extendedAttributes.keys() + delegate: Text { + text: "<b>" + place.extendedAttributes[modelData].label + ": </b>" + + place.extendedAttributes[modelData].text + width: parent.width + font.pixelSize: 16 + wrapMode: Text.WordWrap + } } - Text { id: paymentMethods; font.pixelSize: 16 } } state: 'place-core' @@ -142,8 +153,6 @@ Rectangle { State { name: "place-details" PropertyChanges { target: gradStop; color:"lightskyblue" } - PropertyChanges { target: paymentMethods; text: '<b>Payment methods: </b> ' - + ((place.extendedAttributes.paymentMethods) ? place.extendedAttributes.paymentMethods.text : "No payment methods")} } ] } diff --git a/src/plugins/geoservices/nokia/places/qplacejsondetailsparser.cpp b/src/plugins/geoservices/nokia/places/qplacejsondetailsparser.cpp index 916932e4..eb8259a0 100644 --- a/src/plugins/geoservices/nokia/places/qplacejsondetailsparser.cpp +++ b/src/plugins/geoservices/nokia/places/qplacejsondetailsparser.cpp @@ -864,6 +864,7 @@ void QPlaceJSonDetailsParser::processAdContentPaymentMethods(const QScriptValue } if (list.count()) { QPlaceAttribute paymentMethods; + paymentMethods.setLabel(tr("Payment methods")); paymentMethods.setText(list.join(",")); targetPlace->insertExtendedAttribute(QPlaceAttribute::PaymentMethods, paymentMethods); } @@ -1015,6 +1016,7 @@ void QPlaceJSonDetailsParser::processAdContentOpeningNotes(const QScriptValue &c QString obj = processAdContentOpeningNote(it.value()); if (!obj.isEmpty()) { QPlaceAttribute openingNote; + openingNote.setLabel(tr("Opening note")); openingNote.setText(obj); targetPlace->insertExtendedAttribute(QPlaceAttribute::OpeningNote, openingNote); //! @todo only one is used @@ -1026,6 +1028,7 @@ void QPlaceJSonDetailsParser::processAdContentOpeningNotes(const QScriptValue &c QString obj = processAdContentOpeningNote(value); if (!obj.isEmpty()) { QPlaceAttribute openingNote; + openingNote.setLabel(tr("Opening note")); openingNote.setText(obj); targetPlace->insertExtendedAttribute(QPlaceAttribute::OpeningNote, openingNote); } |