summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-25 19:36:34 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-12 08:22:44 -0700
commita5416b9bead1cfc886531728c2e7602ca75b75c6 (patch)
tree7dd747f17248824a22030a8c938c416d7fb2c647 /core
parent38cda08819842d6dcfdedde0dbf9720958d8c075 (diff)
downloadsubsurface-a5416b9bead1cfc886531728c2e7602ca75b75c6.tar.gz
Bluetooth: remember all data during a scan on macOS
Since we trigger a scan even without the dialog to pick the right device, we need to remember all devices that we find. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r--core/btdiscovery.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp
index 77a3dd3a5..a13cc7078 100644
--- a/core/btdiscovery.cpp
+++ b/core/btdiscovery.cpp
@@ -177,12 +177,11 @@ void BTDiscovery::btDeviceDiscovered(const QBluetoothDeviceInfo &device)
qDebug() << id.toByteArray();
}
-#if defined(Q_OS_IOS) || defined(Q_OS_WIN)
- // On Desktop this is called when "Save" button is clicked. All
- // DeviceInfo are stored as data on the ui list items.
- // On mobile (iOS) the current ConnectionListModel does not support
- // additional data, so just save all discovered devices.
-
+#if defined(Q_OS_IOS) || defined(Q_OS_MACOS) || defined(Q_OS_WIN)
+ // on Windows, macOS and iOS we need to scan in order to be able to access a device;
+ // let's remember the information we scanned on this run so we can at least
+ // refer back to it and don't need to open the separate scanning dialog every
+ // time we try to download from a BT/BLE dive computer.
saveBtDeviceInfo(btDeviceAddress(&device, false), device);
#endif