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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-07-17 06:06:22 -07:00
parent 2ccfce7cf0
commit ec1b22b487

View file

@ -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: {