Sfoglia il codice sorgente

Fix naming of the list properties in addressbook example

Alexey Edelev 3 anni fa
parent
commit
8a1d019eb1

+ 3 - 3
examples/addressbook/qml/AddContactView.qml

@@ -167,8 +167,8 @@ StackItem {
         _streetAddress2.text = newContact.address.streetAddress2
         _zipCode.text = newContact.address.zipCode.toString()
         _state.text = newContact.address.state
-        var phoneNumber = newContact.phonesData.length > 0 ?
-                    newContact.phonesData[0] : null
+        var phoneNumber = newContact.phones.length > 0 ?
+                    newContact.phones[0] : null
         if (phoneNumber) {
             homePhone.number = phoneNumber.number.toString()
         }
@@ -186,7 +186,7 @@ StackItem {
             if (homePhone.number.length !== 0) {
                 phones.push(_homePhoneData);
             }
-            newContact.phonesData = phones;
+            newContact.phones = phones;
 
             AddressBookEngine.addContact(newContact)
             stack.pop()

+ 4 - 4
examples/addressbook/qml/ContactDetails.qml

@@ -60,7 +60,7 @@ StackItem {
                 id: _homePhoneField
                 label: qsTr("Home phone")
                 text: _homePhone ? "+" + _homePhone.countryCode + " " + _homePhone.number : ""
-                property PhoneNumber _homePhone: contact.phonesData[0]
+                property PhoneNumber _homePhone: contact.phones[0]
             }
             DropDownColumn {
                 anchors.right: parent.right
@@ -96,7 +96,7 @@ StackItem {
                 TextRow {
                     id: _jzipCode
                     label: qsTr("Zip code")
-                    text: contact.job.officeAddress.zipCode
+                    text: "" + contact.job.officeAddress.zipCode
                 }
                 TextRow {
                     id: _jstate
@@ -129,7 +129,7 @@ StackItem {
                 TextRow {
                     id: _zipCode
                     label: qsTr("Zip code")
-                    text: contact.address.zipCode
+                    text: "" + contact.address.zipCode
                 }
                 TextRow {
                     id: _state
@@ -156,7 +156,7 @@ StackItem {
         primaryColor: "#4CAF50"
         secondaryColor: "#58cb5c"
         onClicked: {
-            AddressBookEngine.makeCall(contact.phonesData[0])
+            AddressBookEngine.makeCall(contact.phones[0])
             stack.pop();
         }
     }

+ 2 - 2
examples/addressbook/qml/ContactList.qml

@@ -64,8 +64,8 @@ StackItem {
                     Layout.alignment: Qt.AlignVCenter
                     SecondaryText {
                         id: defaultPhoneNumberText
-                        property PhoneNumber defaultPhoneNumber: contactDelegate.contact.phonesData.length > 0 ?
-                                                                     contactDelegate.contact.phonesData[0] : null
+                        property PhoneNumber defaultPhoneNumber: contactDelegate.contact.phones.length > 0 ?
+                                                                     contactDelegate.contact.phones[0] : null
                         visible: defaultPhoneNumber != null
                         text: defaultPhoneNumber ?
                                   "+" + defaultPhoneNumber.countryCode + " " + defaultPhoneNumber.number : ""