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>
This commit is contained in:
Dirk Hohndel 2018-09-25 19:36:34 -07:00
parent 38cda08819
commit a5416b9bea

View file

@ -177,12 +177,11 @@ void BTDiscovery::btDeviceDiscovered(const QBluetoothDeviceInfo &device)
qDebug() << id.toByteArray(); qDebug() << id.toByteArray();
} }
#if defined(Q_OS_IOS) || defined(Q_OS_WIN) #if defined(Q_OS_IOS) || defined(Q_OS_MACOS) || defined(Q_OS_WIN)
// On Desktop this is called when "Save" button is clicked. All // on Windows, macOS and iOS we need to scan in order to be able to access a device;
// DeviceInfo are stored as data on the ui list items. // let's remember the information we scanned on this run so we can at least
// On mobile (iOS) the current ConnectionListModel does not support // refer back to it and don't need to open the separate scanning dialog every
// additional data, so just save all discovered devices. // time we try to download from a BT/BLE dive computer.
saveBtDeviceInfo(btDeviceAddress(&device, false), device); saveBtDeviceInfo(btDeviceAddress(&device, false), device);
#endif #endif