From ec1b22b4871338cf74066a97811731b97e44277b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 17 Jul 2017 06:06:22 -0700 Subject: QML UI: only change connection when finding a match If we can't find a match, just leave it unchanged. This way, if we mis-recognize a device, the user can correct the product (or even vendor) without losing the correct connection. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DownloadFromDiveComputer.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index d57068522..a4db5ef51 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -83,7 +83,9 @@ Kirigami.Page { model: null currentIndex: productidx onCurrentTextChanged: { - comboConnection.currentIndex = downloadThread.data().getMatchingAddress(comboVendor.currentText, currentText) + var newIdx = downloadThread.data().getMatchingAddress(comboVendor.currentText, currentText) + if (newIdx != -1) + comboConnection.currentIndex = newIdx } onModelChanged: { -- cgit v1.2.3-70-g09d2