summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-05-14 17:37:24 -0700
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2020-05-15 04:05:06 +0300
commita1a51e5d89013f0423675dfe607cc136f82f727f (patch)
tree2036f567e9422799b83bcf9708c010c4ae5066ad /core
parent658089d763c1e9e953f5c06b01d028613408138b (diff)
downloadsubsurface-a1a51e5d89013f0423675dfe607cc136f82f727f.tar.gz
core/bt: always add bt name for devices
If the user asks to have all BT/BLE devices shown, we should behave consistently to the case of a recognized dive computer and always show the device name. In almost all cases the BT/BLE address (and even worse on iOS/macOS the weird uuids) are completely meaningless. If there isn't a name, don't add a leading space in order to make it easy to detect if we have an address without a name (which almost certainly isn't a dive computer, so it should be towards the end of the list of addresses - which will be handled in a later commit). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r--core/btdiscovery.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp
index 298c0408c..909c55b23 100644
--- a/core/btdiscovery.cpp
+++ b/core/btdiscovery.cpp
@@ -274,8 +274,11 @@ void BTDiscovery::btDeviceDiscoveredMain(const btPairedDevice &device)
return;
}
// Do we want only devices we recognize as dive computers?
- if (m_showNonDiveComputers)
- connectionListModel.addAddress(device.address);
+ if (m_showNonDiveComputers) {
+ if (!newDevice.isEmpty())
+ newDevice += " ";
+ connectionListModel.addAddress(newDevice + device.address);
+ }
qDebug() << "Not recognized as dive computer";
}