aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-20 12:07:08 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-20 12:07:11 +0900
commit7f7e7cf51db13d9fbe0f3b67eb97a971dcf8cb29 (patch)
treef3e7bb824db14cdb45f4da583021d214e0cce1d2
parent1ccf21f08db1dac83bcb5e1662a9a9b53cdd7cdb (diff)
downloadsubsurface-7f7e7cf51db13d9fbe0f3b67eb97a971dcf8cb29.tar.gz
QML UI: ensure we track vendor/product for download
This is based on something that Anton Ludin sent to the mailing list. Reading through the code it seemed that there were scenarios in which DC_vendor and DC_product were not updated correctly. That's one of the problems of the declarative approach in QML - it can be very hard to figure out which code is run when in certain situations. This may help address the issue with FTDI downloads no longer working on Android. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--mobile-widgets/qml/DownloadFromDiveComputer.qml4
1 files changed, 3 insertions, 1 deletions
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml
index 2f488586f..3da83e5c8 100644
--- a/mobile-widgets/qml/DownloadFromDiveComputer.qml
+++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml
@@ -79,6 +79,7 @@ Kirigami.Page {
elide: Text.ElideRight
}
onCurrentTextChanged: {
+ manager.DC_vendor = currentText
comboProduct.model = manager.getProductListFromVendor(currentText)
if (currentIndex == manager.getDetectedVendorIndex())
comboProduct.currentIndex = manager.getDetectedProductIndex(currentText)
@@ -109,6 +110,7 @@ Kirigami.Page {
elide: Text.ElideRight
}
onCurrentTextChanged: {
+ manager.DC_product = currentText
var newIdx = manager.getMatchingAddress(comboVendor.currentText, currentText)
if (newIdx != -1)
comboConnection.currentIndex = newIdx
@@ -188,7 +190,7 @@ Kirigami.Page {
// strip any BT Name from the address
var devName = manager.DC_devName
manager.DC_devName = devName.replace(/^(.*) /, "")
- manager.appendTextToLog("DCDownloadThread started for " + manager.product + " on "+ manager.DC_devName)
+ manager.appendTextToLog("DCDownloadThread started for " + manager.DC_vendor + " " + manager.DC_product + " on "+ manager.DC_devName)
progressBar.visible = true
downloadThread.start()
}