QML UI: don't overwrite good info with bad

If we don't know the vendor or product, let's not overwrite information
that we may have remembered from the last time the user downloaded from
this dive computer.

Note that this doesn't try to associate a specific cable with the
information used last time. We could be smarter here for people who have
multiple dive computers, but for the most typical user with just one
dive computer, this does seem like a good solution.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-08-09 07:39:01 -07:00
parent fd58441b08
commit 5cdba2d652

View file

@ -410,8 +410,11 @@ Kirigami.ScrollablePage {
stackView.push(downloadFromDc)
if (vendor !== undefined && product !== undefined && connection !== undefined) {
/* set up the correct values on the download page */
if (vendor !== -1)
downloadFromDc.vendor = vendor
if (product !== -1)
downloadFromDc.product = product
if (connection !== -1)
downloadFromDc.connection = connection
}
}