Update downloadfromdivecomputer.cpp

If Bluetooth isn't enabled, don't clear non Bluetooth address.    There was an earlier concern that USB mount point shouldn't be preserved because they may change.   This behavior is different on a Mac where the USB serial mount points tend to be persistent.   Michael tested this on Linux and suggested on saving the mount points for Linux and Windows.

Signed-off-by: jme <32236882+notrege@users.noreply.github.com>
This commit is contained in:
jme 2024-04-16 21:45:53 +01:00 committed by Michael Keller
parent 6b11457ddd
commit 77281f8bfe

View file

@ -624,15 +624,14 @@ void DownloadFromDCWidget::enableBluetoothMode(int state)
ui.chooseBluetoothDevice->setEnabled(state == Qt::Checked);
/* This is convoluted enough to warrant explanation:
1. If we have a Bluetooth device, but no Bluetooth address then scan.
2. If we have a Bluetooth device and address, skip scan.
3. If it's not Bluetooth, clear the device address unless it's a Mac.
Mac USB addresses tend to be persistent and are better saved. */
1. If Bluetooth is enabled, but no Bluetooth address then scan.
2. If Bluetooth is enabled and we have a Bluetooth address, skip scan.
3. If Bluetooth is not enabled, but it's a Bluetooth address, clear it. */
if (state == Qt::Checked) {
if (!isBluetoothAddress(ui.device->currentText()))
selectRemoteBluetoothDevice();
} else
if (isBluetoothAddress(ui.device->currentText()) || QSysInfo::kernelType() != "darwin")
if (isBluetoothAddress(ui.device->currentText()))
ui.device->setCurrentIndex(-1);
}
#endif