diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/qbluetoothsocket_bluez.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bluetooth/qbluetoothsocket_bluez.cpp b/src/bluetooth/qbluetoothsocket_bluez.cpp index 51bc5179..6947e9d0 100644 --- a/src/bluetooth/qbluetoothsocket_bluez.cpp +++ b/src/bluetooth/qbluetoothsocket_bluez.cpp @@ -407,13 +407,13 @@ QString QBluetoothSocketPrivate::peerName() const OrgBluezAdapterInterface adapter(QStringLiteral("org.bluez"), reply.value().path(), QDBusConnection::systemBus()); - QDBusPendingReply<QDBusObjectPath> deviceObjectPath = adapter.CreateDevice(peerAddress); + QDBusPendingReply<QDBusObjectPath> deviceObjectPath = adapter.FindDevice(peerAddress); deviceObjectPath.waitForFinished(); if (deviceObjectPath.isError()) { - if (deviceObjectPath.error().name() != QStringLiteral("org.bluez.Error.AlreadyExists")) + if (deviceObjectPath.error().name() != QStringLiteral("org.bluez.Error.DoesNotExist")) return QString(); - deviceObjectPath = adapter.FindDevice(peerAddress); + deviceObjectPath = adapter.CreateDevice(peerAddress); deviceObjectPath.waitForFinished(); if (deviceObjectPath.isError()) return QString(); |