summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2022-02-07 16:58:02 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-10 13:57:52 +0000
commitcd005a77c51728ec3d1e65ee6f2e5cdea8718833 (patch)
treef5da67ad1a32dcbb8bd5111b4347b7bd2b63a520
parent6c0c3f09af522ced9e2c4e3da3cb8163712b79f3 (diff)
downloadqtconnectivity-cd005a77c51728ec3d1e65ee6f2e5cdea8718833.tar.gz
Keep the bluetooth service name if the remote has provided it
For example the "Bt Chat Server" example application service would always show up as a "Custom Service". Change-Id: If73423d90d5681ee0c3655ef7ee3ad6cd7638755 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit e27c6600eca2c9b704c73a0b6d28780eb236cefb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
index 998472f2..d36a01e3 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
@@ -256,7 +256,10 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_finishSdpScan(QBluetoothServiceD
for (const QBluetoothUuid &id : serviceClassUuids) {
if (id.minimumSize() == 16) {
serviceInfo.setServiceUuid(id);
- serviceInfo.setServiceName(QBluetoothServiceDiscoveryAgent::tr("Custom Service"));
+ if (serviceInfo.serviceName().isEmpty()) {
+ serviceInfo.setServiceName(
+ QBluetoothServiceDiscoveryAgent::tr("Custom Service"));
+ }
QBluetoothServiceInfo::Sequence modSeq =
serviceInfo.attribute(QBluetoothServiceInfo::ServiceClassIds).value<QBluetoothServiceInfo::Sequence>();
modSeq.removeOne(QVariant::fromValue(id));