From 87c3378a8b716b896ca0cb72ccfb2e13f748058a Mon Sep 17 00:00:00 2001 From: Matt Porter Date: Mon, 21 May 2018 12:32:37 -0400 Subject: phone: add discrete call function parameters Adjust the call function to accept discrete parameters for the name and phone number to dial. This prepares the app for a reworked UI where the contact model is not always used to invoke a phone call. Bug-AGL: SPEC-1435 Change-Id: I178a7eb6c4854f755abd94234a648f861d5c1326 Signed-off-by: Matt Porter --- app/ContactsView.qml | 4 ++-- app/Dialer.qml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/ContactsView.qml b/app/ContactsView.qml index 8d37590..cab8f09 100644 --- a/app/ContactsView.qml +++ b/app/ContactsView.qml @@ -37,7 +37,7 @@ Item { } } - signal call(var contact) + signal call(var cname, var cnumber) signal cancel ListView { @@ -88,7 +88,7 @@ Item { } } onClicked: { - root.call(model) + root.call(model.name, model.numbers.get(0).number) } } section.property: 'name' diff --git a/app/Dialer.qml b/app/Dialer.qml index f9c3e27..4720e14 100644 --- a/app/Dialer.qml +++ b/app/Dialer.qml @@ -57,9 +57,9 @@ Item { } signal showContacts - function call(contact) { - name.text = contact.name - var rawNumber = contact.numbers.get(0).number + function call(cname, cnumber) { + name.text = cname + var rawNumber = cnumber number.text = rawNumber.replace(/-/g, '') callButton.checked = true } -- cgit 1.2.3-korg