diff options
author | Eric Lemanissier <eric.lemanissier@gmail.com> | 2018-07-02 17:22:22 +0200 |
---|---|---|
committer | Eric Lemanissier <eric.lemanissier@gmail.com> | 2018-07-23 09:51:15 +0000 |
commit | 150297f4884437ae22b03ed464313cd4d33088c1 (patch) | |
tree | 93697bfb0b1504d5e15cd4401c1762ddecafd378 /src/bluetooth/qbluetoothsocket.cpp | |
parent | 21981b8ff96d5a5b5685ab33bb22959c3b584aaf (diff) |
fix use of default constructed QBluetoothSocket
by checking the service passed to QBluetoothSocket::connectToService,
instead of the previous protocol of the socket
fixes up 21e7cb1bafdfc06c263e10067d02f9b103ff660f
Change-Id: I2aa30cdd618f834e718508c5f492fc211d328565
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothsocket.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothsocket.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothsocket.cpp b/src/bluetooth/qbluetoothsocket.cpp index 1ad3ffc2..803de43c 100644 --- a/src/bluetooth/qbluetoothsocket.cpp +++ b/src/bluetooth/qbluetoothsocket.cpp @@ -345,13 +345,13 @@ void QBluetoothSocket::connectToService(const QBluetoothServiceInfo &service, Op #else #if defined(QT_WINRT_BLUETOOTH) // Report these problems early: - if (socketType() != QBluetoothServiceInfo::RfcommProtocol) { + if (service.socketProtocol() != QBluetoothServiceInfo::RfcommProtocol) { d->errorString = tr("Socket type not supported"); setSocketError(QBluetoothSocket::UnsupportedProtocolError); return; } #endif // QT_WINRT_BLUETOOTH - if (socketType() == QBluetoothServiceInfo::UnknownProtocol) { + if (service.socketProtocol() == QBluetoothServiceInfo::UnknownProtocol) { qCWarning(QT_BT) << "QBluetoothSocket::connectToService cannot " "connect with 'UnknownProtocol' type"; d->errorString = tr("Socket type not supported"); |