SMS app: Initialize the device combo when devices appear

Solves T8344
This commit is contained in:
Aleix Pol 2018-04-08 02:06:09 +02:00
parent fdb03afb4d
commit 11071b4894

View file

@ -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"
}