From 77281f8bfe16050e1e68efa1696f37f85b3c21fc Mon Sep 17 00:00:00 2001 From: jme <32236882+notrege@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:45:53 +0100 Subject: [PATCH] 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> --- desktop-widgets/downloadfromdivecomputer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index 3f61fc497..7f7c7774d 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -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