summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-09 07:39:01 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-11 11:14:22 -0700
commit5cdba2d652d8890a7557d5c101e32e7464c29536 (patch)
tree32d3f0edbf6656f67acaf134fbe26ceaef6f44d2
parentfd58441b085a55df6c6da75131eb75fb0a65a0a1 (diff)
downloadsubsurface-5cdba2d652d8890a7557d5c101e32e7464c29536.tar.gz
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>
-rw-r--r--mobile-widgets/qml/DiveList.qml9
1 files changed, 6 insertions, 3 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml
index f0e14f9b0..86d4a9c1a 100644
--- a/mobile-widgets/qml/DiveList.qml
+++ b/mobile-widgets/qml/DiveList.qml
@@ -410,9 +410,12 @@ Kirigami.ScrollablePage {
stackView.push(downloadFromDc)
if (vendor !== undefined && product !== undefined && connection !== undefined) {
/* set up the correct values on the download page */
- downloadFromDc.vendor = vendor
- downloadFromDc.product = product
- downloadFromDc.connection = connection
+ if (vendor !== -1)
+ downloadFromDc.vendor = vendor
+ if (product !== -1)
+ downloadFromDc.product = product
+ if (connection !== -1)
+ downloadFromDc.connection = connection
}
}