How to read an email address from a Person of PeopleModel?
The documentation of the nemo-qml-plugin-contacts suggests, that the emailDetails
of a Person are returned as a QVariantList. Unfortunately I couldn't manage to get the email addresses. A similar challange is to get the phone numbers.
I have looked at the EmailEditor.qml and MultiTypeFieldEditor.qml of the default Sailfish email app. The value field of the QVariant object in the QVariantList seems to be "address", but I always get "undifiend" in the log. Here are some trials:
var contact = contacts.personById(contactIdentifier)
for (var emailDetails in contact.emailDetails) {
console.log("- " + emailDetails['address'])
console.log("- " + emailDetails.address)
console.log("- " + emailDetails.value)
console.log("- " + emailDetails.label)
}
The toString()
method returns just the index of the QVariant object.
Has someone an idea?