From 3b55bbd1fbac94def3718133db574823948c3b01 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Tue, 6 Sep 2011 14:16:01 +1000 Subject: Display all additional place properties. Change-Id: Ie9b24929eed2c9c678ec4e53561403ced27e845f Reviewed-on: http://codereview.qt.nokia.com/4232 Reviewed-by: Qt Sanity Bot Reviewed-by: abcd Reviewed-by: Aaron McCarthy --- examples/declarative/qmlplaces/SearchResultDelegate.qml | 15 ++++++++++++--- .../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: "" + place.extendedAttributes[modelData].label + ": " + + 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: 'Payment methods: ' - + ((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); } -- cgit v1.2.1