diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-05-23 10:17:07 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-26 08:47:40 +0200 |
commit | c843e302a1301f6c9843a2632089bbe65a41b105 (patch) | |
tree | 2d70cf9e2effee462c6882d86449c905a7e5dabd | |
parent | aa9f0dfbb302876a874f9d928ccee0fbfcf91493 (diff) |
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 <bea.lam@jollamobile.com>
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp | 2 | ||||
-rw-r--r-- | 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(); |