From 9902dfdbc44934ce2e8072bc237ca8cdbfb3402b Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Thu, 13 Feb 2014 10:54:51 +0100 Subject: Fix missing QBluetoothSocket::state update after unsuccessful SDP search When connectToService() triggers an SDP discovery the search may fail. At the beginning of the discovery the socket state was set to ServiceLookupState. This patch ensures that the socket state resets to Unconnected if the SDP discovery failed. Currently only Bluez uses this discovery mechanism and therefore is the only affected platform. Change-Id: I982dafc1f5466071bbf910ed3cf7cf7abda14fe4 Reviewed-by: Fabian Bumberger --- src/bluetooth/qbluetoothsocket.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bluetooth/qbluetoothsocket.cpp b/src/bluetooth/qbluetoothsocket.cpp index 2f2660d0..73d82591 100644 --- a/src/bluetooth/qbluetoothsocket.cpp +++ b/src/bluetooth/qbluetoothsocket.cpp @@ -548,6 +548,7 @@ void QBluetoothSocket::discoveryFinished() qCDebug(QT_BT) << "Didn't find any"; d->errorString = tr("Service cannot be found"); setSocketError(ServiceNotFoundError); + setSocketState(QBluetoothSocket::UnconnectedState); d->discoveryAgent->deleteLater(); d->discoveryAgent = 0; } -- cgit v1.2.3