summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2015-03-19 10:01:10 +0100
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-03-19 14:49:24 +0000
commita888044ed7c4ac1422f5e1f73fe747f0cd2f7531 (patch)
tree8862d8124aba90fa0871b1ea36fef5e6b86ec3e4
parentd70cba381938a2043b66211dcca07c012f3fa34a (diff)
OSX: Minor signal and readability fix for QBluetoothSocket
1.) QBluetoothSocketPrivate::close() is always called after the socket state has changed to ClosingState. The removed check was meaningless. 2.) Ensure socket is set to NotOpen and ClosingState before we start the socket's abort() process. Change-Id: Idf693be2068f77020113f38612b03565a2a89ca4 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
-rw-r--r--src/bluetooth/qbluetoothsocket_osx.mm8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/bluetooth/qbluetoothsocket_osx.mm b/src/bluetooth/qbluetoothsocket_osx.mm
index 808b8e5a..1d8cbd10 100644
--- a/src/bluetooth/qbluetoothsocket_osx.mm
+++ b/src/bluetooth/qbluetoothsocket_osx.mm
@@ -153,10 +153,6 @@ void QBluetoothSocketPrivate::close()
Q_ASSERT_X(!isConnecting, Q_FUNC_INFO, "internal inconsistency - "
"still in connectToService()");
- // Only go through closing if the socket was fully opened
- if (state == QBluetoothSocket::ConnectedState)
- q_ptr->setSocketState(QBluetoothSocket::ClosingState);
-
if (!txBuffer.size())
abort();
}
@@ -596,15 +592,17 @@ void QBluetoothSocket::abort()
if (state() == UnconnectedState)
return;
+ setOpenMode(NotOpen);
+
if (state() == ServiceLookupState && d_ptr->discoveryAgent) {
d_ptr->discoveryAgent->disconnect();
d_ptr->discoveryAgent->stop();
d_ptr->discoveryAgent.reset();
}
+ setSocketState(QBluetoothSocket::ClosingState);
d_ptr->abort();
- setOpenMode(NotOpen);
setSocketState(QBluetoothSocket::UnconnectedState);
emit disconnected();
}