summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-15 11:45:12 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-16 07:58:20 -0700
commit4619b4932eb2f75f8026b79e8a810ddf5f5fd7e9 (patch)
tree81986654da0329cc4354f84ff530a9c87bd2f846 /mobile-widgets/qml
parentae537fc4007cad207916af6d2aa262e0391399d1 (diff)
downloadsubsurface-4619b4932eb2f75f8026b79e8a810ddf5f5fd7e9.tar.gz
android/usb: refresh USB device list on entering download from DC
The usbRescan() code is smart enough not to duplicate entries that might already be there. And with this the user doesn't have to manually tap rescan if they didn't open Subsurface-mobile via the intent after a device was plugged in. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r--mobile-widgets/qml/DownloadFromDiveComputer.qml4
1 files changed, 4 insertions, 0 deletions
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml
index b0eda16f3..8ef4520a2 100644
--- a/mobile-widgets/qml/DownloadFromDiveComputer.qml
+++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml
@@ -481,9 +481,13 @@ Kirigami.Page {
comboVendor.currentIndex = comboProduct.currentIndex = comboConnection.currentIndex = -1
dc1.enabled = dc2.enabled = dc3.enabled = dc4.enabled = true
if (visible) {
+ // we started the BT/BLE scan when Subsurface-mobile started, let's see if
+ // that found something
comboVendor.currentIndex = manager.getDetectedVendorIndex()
comboProduct.currentIndex = manager.getDetectedProductIndex(comboVendor.currentText)
comboConnection.currentIndex = manager.getMatchingAddress(comboVendor.currentText, comboProduct.currentText)
+ // also check if there are USB devices (this only has an effect on Android)
+ manager.usbRescan()
}
}
}