summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/btdeviceselectiondialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/btdeviceselectiondialog.cpp')
-rw-r--r--desktop-widgets/btdeviceselectiondialog.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/desktop-widgets/btdeviceselectiondialog.cpp b/desktop-widgets/btdeviceselectiondialog.cpp
index de3e383c5..fc7b2e86f 100644
--- a/desktop-widgets/btdeviceselectiondialog.cpp
+++ b/desktop-widgets/btdeviceselectiondialog.cpp
@@ -449,13 +449,25 @@ void BtDeviceSelectionDialog::deviceDiscoveryError(QBluetoothDeviceDiscoveryAgen
}
extern QString markBLEAddress(const QBluetoothDeviceInfo *device);
+extern QString btDeviceAddress(const QBluetoothDeviceInfo *device, bool isBle);
QString BtDeviceSelectionDialog::getSelectedDeviceAddress()
{
- if (selectedRemoteDeviceInfo)
- return markBLEAddress(selectedRemoteDeviceInfo.data());
+ if (!selectedRemoteDeviceInfo)
+ return QString();
- return QString();
+ int btMode = ui->btMode->currentIndex();
+ QBluetoothDeviceInfo *device = selectedRemoteDeviceInfo.data();
+
+ switch (btMode) {
+ case 0: // Auto
+ default:
+ return markBLEAddress(device);
+ case 1: // Force LE
+ return btDeviceAddress(device, true);
+ case 2: // Force classical
+ return btDeviceAddress(device, false);
+ }
}
QString BtDeviceSelectionDialog::getSelectedDeviceName()