From 11071b4894658e4b6f6bf43e6fa26e6687972c0a Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Sun, 8 Apr 2018 02:06:09 +0200 Subject: [PATCH] SMS app: Initialize the device combo when devices appear Solves T8344 --- smsapp/qml/ContactList.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/smsapp/qml/ContactList.qml b/smsapp/qml/ContactList.qml index c269ca3b2..67f5f2293 100644 --- a/smsapp/qml/ContactList.qml +++ b/smsapp/qml/ContactList.qml @@ -86,10 +86,13 @@ Kirigami.ScrollablePage } footer: ComboBox { id: devicesCombo - readonly property QtObject device: model.data(model.index(currentIndex, 0), DevicesModel.DeviceRole) + readonly property QtObject device: currentIndex>0 ? model.data(model.index(currentIndex, 0), DevicesModel.DeviceRole) : null model: DevicesSortProxyModel { //TODO: make it possible to sort only if they can do sms sourceModel: DevicesModel { displayFilter: DevicesModel.Paired | DevicesModel.Reachable } + onRowsInserted: if (devicesCombo.currentIndex < 0) { + devicesCombo.currentIndex = 0 + } } textRole: "display" }