diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2015-03-18 15:50:15 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-03-19 14:50:33 +0000 |
commit | 752de447fe646c20f35b0b304ec2ff737be10ab6 (patch) | |
tree | 92a7facaeacf1803f4aab4fc480e27ee3523d06f /src/bluetooth/qbluetoothsocket_bluez.cpp | |
parent | 669b427653f8f708269431917f720f7e76680191 (diff) |
Minor code optimization
QBluetoothSocketPrivate::close() was always called when the internal
socket state has been set to ClosingState. The removed checks were
meaningless.
Change-Id: Ia36808a21de7dd1076cdd47bca8fd6855ec957c3
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothsocket_bluez.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothsocket_bluez.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/bluetooth/qbluetoothsocket_bluez.cpp b/src/bluetooth/qbluetoothsocket_bluez.cpp index 9eedc492..9f68386c 100644 --- a/src/bluetooth/qbluetoothsocket_bluez.cpp +++ b/src/bluetooth/qbluetoothsocket_bluez.cpp @@ -511,20 +511,10 @@ qint64 QBluetoothSocketPrivate::readData(char *data, qint64 maxSize) void QBluetoothSocketPrivate::close() { - Q_Q(QBluetoothSocket); - - // Only go through closing if the socket was fully opened - if(state == QBluetoothSocket::ConnectedState) - q->setSocketState(QBluetoothSocket::ClosingState); - - if(txBuffer.size() > 0 && - state == QBluetoothSocket::ClosingState){ + if (txBuffer.size() > 0) connectWriteNotifier->setEnabled(true); - } - else { + else abort(); - } - } bool QBluetoothSocketPrivate::setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType_, |