From c843e302a1301f6c9843a2632089bbe65a41b105 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Fri, 23 May 2014 10:17:07 +0200 Subject: Use Alias as Device/Adapter name on Bluez 5 Bluez5 docs recommend to use the Alias rather than the Name property. This ensures that a potentially user chosen device name is used rather than the actual device name. If no Alias is set the property automatically reverts back to the Name value. Change-Id: If2b397cf49df6dc78bb205c1136b8d1dd5e7c02f Reviewed-by: Bea Lam Reviewed-by: Aaron McCarthy --- src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp | 2 +- src/bluetooth/qbluetoothlocaldevice_bluez.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp index a84a9b82..983228c8 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp @@ -343,7 +343,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::deviceFoundBluez5(const QString& dev if (btAddress.isNull()) // no point reporting an empty address return; - const QString btName = device.name(); + const QString btName = device.alias(); quint32 btClass = device.classProperty(); qCDebug(QT_BT_BLUEZ) << "Discovered: " << btAddress.toString() << btName diff --git a/src/bluetooth/qbluetoothlocaldevice_bluez.cpp b/src/bluetooth/qbluetoothlocaldevice_bluez.cpp index 665f9096..98894dff 100644 --- a/src/bluetooth/qbluetoothlocaldevice_bluez.cpp +++ b/src/bluetooth/qbluetoothlocaldevice_bluez.cpp @@ -89,7 +89,7 @@ QString QBluetoothLocalDevice::name() const return reply.value().value(QStringLiteral("Name")).toString(); } else if (d_ptr->adapterBluez5) { - return d_ptr->adapterBluez5->name(); + return d_ptr->adapterBluez5->alias(); } return QString(); -- cgit v1.2.3