summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/btdeviceselectiondialog.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-06-29 19:43:00 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-06-30 13:12:07 -0700
commit6837120bb121cd40ec8fc83424849af1ed3756be (patch)
tree7968a640058d79e3e60ca493a67afbd53ab88b7b /desktop-widgets/btdeviceselectiondialog.cpp
parenta4d4d1c83b3eef902f7c4443a3e2894b45a0f7b7 (diff)
downloadsubsurface-6837120bb121cd40ec8fc83424849af1ed3756be.tar.gz
BLE handling: create helper function to add the LE: prefix
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/btdeviceselectiondialog.cpp')
-rw-r--r--desktop-widgets/btdeviceselectiondialog.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/desktop-widgets/btdeviceselectiondialog.cpp b/desktop-widgets/btdeviceselectiondialog.cpp
index 6502978c4..049246703 100644
--- a/desktop-widgets/btdeviceselectiondialog.cpp
+++ b/desktop-widgets/btdeviceselectiondialog.cpp
@@ -424,18 +424,12 @@ void BtDeviceSelectionDialog::deviceDiscoveryError(QBluetoothDeviceDiscoveryAgen
ui->dialogStatus->setText(tr("Device discovery error: %1.").arg(errorDescription));
}
+extern QString markBLEAddress(const QBluetoothDeviceInfo *device);
+
QString BtDeviceSelectionDialog::getSelectedDeviceAddress()
{
- if (selectedRemoteDeviceInfo) {
- QBluetoothDeviceInfo *deviceInfo = selectedRemoteDeviceInfo.data();
- QBluetoothDeviceInfo::CoreConfigurations flags;
- QString prefix = "";
-
- flags = deviceInfo->coreConfigurations();
- if (flags == QBluetoothDeviceInfo::LowEnergyCoreConfiguration)
- prefix = "LE:";
- return prefix + deviceInfo->address().toString();
- }
+ if (selectedRemoteDeviceInfo)
+ return markBLEAddress(selectedRemoteDeviceInfo.data());
return QString();
}