From 844382001f8deaa7fcc9faac779b24188f35329b Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Sun, 24 Sep 2017 23:54:54 +0200 Subject: Replace Q_NULLPTR with nullptr Change-Id: Ica194c2568465a94d851ddeaf62ca71b33fe4464 Reviewed-by: Lars Knoll --- src/bluetooth/qbluetoothserver_osx.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/bluetooth/qbluetoothserver_osx.mm') diff --git a/src/bluetooth/qbluetoothserver_osx.mm b/src/bluetooth/qbluetoothserver_osx.mm index 8896651d..c72845bb 100644 --- a/src/bluetooth/qbluetoothserver_osx.mm +++ b/src/bluetooth/qbluetoothserver_osx.mm @@ -237,7 +237,7 @@ QBluetoothServerPrivate *QBluetoothServerPrivate::registeredServer(quint16 port, qCWarning(QT_BT_OSX) << "invalid protocol"; } - return Q_NULLPTR; + return nullptr; } void QBluetoothServerPrivate::unregisterServer(QBluetoothServerPrivate *server) @@ -441,7 +441,7 @@ bool QBluetoothServer::hasPendingConnections() const QBluetoothSocket *QBluetoothServer::nextPendingConnection() { if (!d_ptr->pendingConnections.size()) - return Q_NULLPTR; + return nullptr; QScopedPointer newSocket(new QBluetoothSocket); QBluetoothServerPrivate::PendingConnection channel(d_ptr->pendingConnections.front()); @@ -451,10 +451,10 @@ QBluetoothSocket *QBluetoothServer::nextPendingConnection() if (d_ptr->serverType == QSInfo::RfcommProtocol) { if (!newSocket->d_ptr->setChannel(static_cast(channel))) - return Q_NULLPTR; + return nullptr; } else { if (!newSocket->d_ptr->setChannel(static_cast(channel))) - return Q_NULLPTR; + return nullptr; } return newSocket.take(); -- cgit v1.2.3 From 4bce1481c5cfbd402973c2a488b36499ed44af2e Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 11 Oct 2017 10:10:27 +0200 Subject: IOBluetooth: warn about incorrent thread/runloop IOBluetooth is heavily based on CFRunLoops. An attempt to use it on a thread, that does not properly run CFRunLoop results in callbacks never firing and thus QBluetooth classes never finishing their jobs, including: - device discovery - service discovery - RFCOMM/LCAP2 - Bluetooth server - Bluetooth socket etc. While we cannot fix the core problem until we have a properly working CoreFoundation event dispatcher, we can at least issue a warning so that people do not waste their time debugging this well-known limitation. Task-number: QTBUG-63630 Change-Id: Iefa4d675ea0962167bdfede640d2087dbdf37b18 Reviewed-by: Alex Blasche --- src/bluetooth/qbluetoothserver_osx.mm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/bluetooth/qbluetoothserver_osx.mm') diff --git a/src/bluetooth/qbluetoothserver_osx.mm b/src/bluetooth/qbluetoothserver_osx.mm index 8896651d..8d7eeb29 100644 --- a/src/bluetooth/qbluetoothserver_osx.mm +++ b/src/bluetooth/qbluetoothserver_osx.mm @@ -291,6 +291,8 @@ bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port) { typedef QBluetoothServerPrivate::ObjCListener ObjCListener; + OSXBluetooth::qt_test_iobluetooth_runloop(); + if (d_ptr->listener) { qCWarning(QT_BT_OSX) << "already in listen mode, close server first"; return false; -- cgit v1.2.3