diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2017-10-17 08:56:40 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2017-10-17 08:56:47 +0200 |
commit | 125cdccc346903d6e70ed26289cdaed85e26ec3f (patch) | |
tree | 7df8ca41816c24ccfa6e0c6add4612689a933bdd /src | |
parent | 844382001f8deaa7fcc9faac779b24188f35329b (diff) | |
parent | 013ad0570844975cd5c72a77d1cfefa30c3ea656 (diff) |
Merge remote-tracking branch 'gerrit/5.10' into dev
Change-Id: I3bf7130a204aebd6a52dfe68bfea57767ba1b70e
Diffstat (limited to 'src')
24 files changed, 130 insertions, 75 deletions
diff --git a/src/bluetooth/doc/src/bluetooth-cpp.qdoc b/src/bluetooth/doc/src/bluetooth-cpp.qdoc index ae39772f..26cd060b 100644 --- a/src/bluetooth/doc/src/bluetooth-cpp.qdoc +++ b/src/bluetooth/doc/src/bluetooth-cpp.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt local connectivty modules. ** @@ -11,8 +11,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -20,7 +20,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/bluetooth/doc/src/bluetooth-index.qdoc b/src/bluetooth/doc/src/bluetooth-index.qdoc index d2db7aa3..9cb5f3b2 100644 --- a/src/bluetooth/doc/src/bluetooth-index.qdoc +++ b/src/bluetooth/doc/src/bluetooth-index.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -20,7 +20,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/bluetooth/doc/src/bluetooth-le-overview.qdoc b/src/bluetooth/doc/src/bluetooth-le-overview.qdoc index a29f88d0..60181240 100644 --- a/src/bluetooth/doc/src/bluetooth-le-overview.qdoc +++ b/src/bluetooth/doc/src/bluetooth-le-overview.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt local connectivty modules. ** @@ -11,8 +11,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -20,7 +20,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/bluetooth/doc/src/bluetooth-overview.qdoc b/src/bluetooth/doc/src/bluetooth-overview.qdoc index 1b712f23..8138e937 100644 --- a/src/bluetooth/doc/src/bluetooth-overview.qdoc +++ b/src/bluetooth/doc/src/bluetooth-overview.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt local connectivty modules. ** @@ -11,8 +11,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -20,7 +20,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/bluetooth/doc/src/bluetooth-qml.qdoc b/src/bluetooth/doc/src/bluetooth-qml.qdoc index 2fb64f45..51aa5a25 100644 --- a/src/bluetooth/doc/src/bluetooth-qml.qdoc +++ b/src/bluetooth/doc/src/bluetooth-qml.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt local connectivty modules. ** @@ -11,8 +11,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -20,7 +20,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/bluetooth/doc/src/examples.qdoc b/src/bluetooth/doc/src/examples.qdoc index 32152c84..e33ae4d8 100644 --- a/src/bluetooth/doc/src/examples.qdoc +++ b/src/bluetooth/doc/src/examples.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -20,7 +20,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/bluetooth/osx/osxbtcentralmanager.mm b/src/bluetooth/osx/osxbtcentralmanager.mm index 15354f80..70473f1f 100644 --- a/src/bluetooth/osx/osxbtcentralmanager.mm +++ b/src/bluetooth/osx/osxbtcentralmanager.mm @@ -1031,7 +1031,7 @@ QT_END_NAMESPACE using namespace OSXBluetooth; const auto state = central.state; -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) if (state == CBManagerStateUnknown || state == CBManagerStateResetting) { #else @@ -1047,7 +1047,7 @@ QT_END_NAMESPACE } // Let's check some states we do not like first: -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) if (state == CBManagerStateUnsupported || state == CBManagerStateUnauthorized) { #else if (state == CBCentralManagerStateUnsupported || state == CBCentralManagerStateUnauthorized) { @@ -1067,7 +1067,7 @@ QT_END_NAMESPACE return; } -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) if (state == CBManagerStatePoweredOff) { #else if (state == CBCentralManagerStatePoweredOff) { @@ -1086,7 +1086,7 @@ QT_END_NAMESPACE return; } -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) if (state == CBManagerStatePoweredOn) { #else if (state == CBCentralManagerStatePoweredOn) { diff --git a/src/bluetooth/osx/osxbtledeviceinquiry.mm b/src/bluetooth/osx/osxbtledeviceinquiry.mm index 05b20167..7a516dd4 100644 --- a/src/bluetooth/osx/osxbtledeviceinquiry.mm +++ b/src/bluetooth/osx/osxbtledeviceinquiry.mm @@ -234,7 +234,7 @@ QT_USE_NAMESPACE Q_ASSERT(leQueue); const auto state = central.state; -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) if (state == CBManagerStatePoweredOn) { #else if (state == CBCentralManagerStatePoweredOn) { @@ -259,7 +259,7 @@ QT_USE_NAMESPACE [manager scanForPeripheralsWithServices:nil options:nil]; } // Else we ignore. -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) } else if (state == CBManagerStateUnsupported || state == CBManagerStateUnauthorized) { #else } else if (state == CBCentralManagerStateUnsupported || state == CBCentralManagerStateUnauthorized) { @@ -276,7 +276,7 @@ QT_USE_NAMESPACE } [manager setDelegate:nil]; -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) } else if (state == CBManagerStatePoweredOff) { #else } else if (state == CBCentralManagerStatePoweredOff) { diff --git a/src/bluetooth/osx/osxbtperipheralmanager.mm b/src/bluetooth/osx/osxbtperipheralmanager.mm index 9c443cf6..64c8cd90 100644 --- a/src/bluetooth/osx/osxbtperipheralmanager.mm +++ b/src/bluetooth/osx/osxbtperipheralmanager.mm @@ -391,7 +391,7 @@ bool qt_validate_value_range(const QLowEnergyCharacteristicData &data) if (peripheral != manager || !notifier) return; -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) if (peripheral.state == CBManagerStatePoweredOn) { #else if (peripheral.state == CBPeripheralManagerStatePoweredOn) { @@ -426,7 +426,7 @@ bool qt_validate_value_range(const QLowEnergyCharacteristicData &data) explicitly added again." */ -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) +#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13) if (peripheral.state == CBManagerStateUnauthorized || peripheral.state == CBManagerStateUnsupported) { #else diff --git a/src/bluetooth/osx/osxbtutility.mm b/src/bluetooth/osx/osxbtutility.mm index 1508c89f..e17006de 100644 --- a/src/bluetooth/osx/osxbtutility.mm +++ b/src/bluetooth/osx/osxbtutility.mm @@ -48,6 +48,7 @@ #ifndef QT_IOS_BLUETOOTH #import <IOBluetooth/objc/IOBluetoothSDPUUID.h> +#import <CoreFoundation/CoreFoundation.h> #if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12, __IPHONE_NA) #import <CoreBluetooth/CBUUID.h> #endif @@ -164,7 +165,19 @@ QString qt_error_string(IOReturn errorCode) } } -#endif +void qt_test_iobluetooth_runloop() +{ + // IOBluetooth heavily relies on a CFRunLoop machinery in a way it dispatches + // its callbacks. Technically, having a QThread with CFRunLoop-based event + // dispatcher would suffice. At the moment of writing we do not have such + // event dispatcher, so we only can work on the main thread. + if (CFRunLoopGetMain() != CFRunLoopGetCurrent()) { + qCWarning(QT_BT_OSX) << "IOBluetooth works only on the main thread or a" + << "thread with a running CFRunLoop"; + } +} + +#endif // !QT_IOS_BLUETOOTH // Apple has: CBUUID, NSUUID, CFUUID, IOBluetoothSDPUUID diff --git a/src/bluetooth/osx/osxbtutility_p.h b/src/bluetooth/osx/osxbtutility_p.h index 441d4183..c2bc6cf8 100644 --- a/src/bluetooth/osx/osxbtutility_p.h +++ b/src/bluetooth/osx/osxbtutility_p.h @@ -287,8 +287,9 @@ BluetoothDeviceAddress iobluetooth_address(const QBluetoothAddress &address); ObjCStrongReference<IOBluetoothSDPUUID> iobluetooth_uuid(const QBluetoothUuid &uuid); QBluetoothUuid qt_uuid(IOBluetoothSDPUUID *uuid); QString qt_error_string(IOReturn errorCode); +void qt_test_iobluetooth_runloop(); -#endif +#endif // !QT_IOS_BLUETOOTH QBluetoothUuid qt_uuid(CBUUID *uuid); CFStrongReference<CFUUIDRef> cf_uuid(const QBluetoothUuid &qtUuid); @@ -313,4 +314,23 @@ Q_DECLARE_LOGGING_CATEGORY(QT_BT_OSX) QT_END_NAMESPACE +#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(101300) && QT_MACOS_DEPLOYMENT_TARGET_BELOW(101300) + + // In the macOS 10.13 SDK, the identifier property was moved from the CBPeripheral + // and CBCentral classes to a new CBPeer base class. Because CBPeer is only available + // on macOS 10.13 and above, the same is true for -[CBPeer identifier]. However, + // since we know that the derived classes have always had this property, + // we'll explicitly mark its availability here. This will not adversely affect + // using the identifier through the CBPeer base class, which will still require macOS 10.13. + +@interface CBPeripheral (UnguardedWorkaround) +@property (readonly, nonatomic) NSUUID *identifier NS_AVAILABLE(10_7, 5_0); +@end + +@interface CBCentral (UnguardedWorkaround) +@property (readonly, nonatomic) NSUUID *identifier NS_AVAILABLE(10_7, 5_0); +@end + +#endif + #endif diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm b/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm index 5ebc131c..fed33bb2 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_osx.mm @@ -245,6 +245,8 @@ void QBluetoothDeviceDiscoveryAgentPrivate::startClassic() Q_ASSERT(requestedMethods & QBluetoothDeviceDiscoveryAgent::ClassicMethod); Q_ASSERT(agentState == NonActive); + OSXBluetooth::qt_test_iobluetooth_runloop(); + if (!inquiry) { // The first Classic scan for this DDA. inquiry.reset([[DeviceInquiryObjC alloc]initWithDelegate:this]); diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp index e9641344..6786ac54 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp @@ -108,7 +108,7 @@ private: HRESULT onBluetoothLEDeviceFound(ComPtr<IBluetoothLEDevice> device, PairingCheck pairingCheck = CheckForPairing); public slots: - void handleLeTimeout(); + void finishDiscovery(); Q_SIGNALS: void deviceFound(const QBluetoothDeviceInfo &info); @@ -257,7 +257,7 @@ void QWinRTBluetoothDeviceDiscoveryWorker::setupLEDeviceWatcher() Q_ASSERT_SUCCEEDED(hr); } -void QWinRTBluetoothDeviceDiscoveryWorker::handleLeTimeout() +void QWinRTBluetoothDeviceDiscoveryWorker::finishDiscovery() { emit scanFinished(); deleteLater(); @@ -273,6 +273,9 @@ void QWinRTBluetoothDeviceDiscoveryWorker::classicBluetoothInfoFromDeviceIdAsync HRESULT hr = m_deviceStatics->FromIdAsync(deviceId, &deviceFromIdOperation); if (FAILED(hr)) { --m_pendingPairedDevices; + if (!m_pendingPairedDevices + && !(requestedModes & QBluetoothDeviceDiscoveryAgent::LowEnergyMethod)) + finishDiscovery(); qCWarning(QT_BT_WINRT) << "Could not obtain bluetooth device from id"; return S_OK; } @@ -281,6 +284,9 @@ void QWinRTBluetoothDeviceDiscoveryWorker::classicBluetoothInfoFromDeviceIdAsync (this, &QWinRTBluetoothDeviceDiscoveryWorker::onPairedClassicBluetoothDeviceFoundAsync).Get()); if (FAILED(hr)) { --m_pendingPairedDevices; + if (!m_pendingPairedDevices + && !(requestedModes & QBluetoothDeviceDiscoveryAgent::LowEnergyMethod)) + finishDiscovery(); qCWarning(QT_BT_WINRT) << "Could not register device found callback"; return S_OK; } @@ -396,6 +402,8 @@ HRESULT QWinRTBluetoothDeviceDiscoveryWorker::onPairedClassicBluetoothDeviceFoun QMetaObject::invokeMethod(this, "deviceFound", Qt::AutoConnection, Q_ARG(QBluetoothDeviceInfo, info)); + if (!m_pendingPairedDevices && !(requestedModes & QBluetoothDeviceDiscoveryAgent::LowEnergyMethod)) + finishDiscovery(); return S_OK; } @@ -566,7 +574,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start(QBluetoothDeviceDiscoveryAgent leScanTimer->setSingleShot(true); } connect(leScanTimer, &QTimer::timeout, - worker, &QWinRTBluetoothDeviceDiscoveryWorker::handleLeTimeout); + worker, &QWinRTBluetoothDeviceDiscoveryWorker::finishDiscovery); leScanTimer->setInterval(lowEnergySearchTimeout); leScanTimer->start(); } @@ -629,7 +637,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::disconnectAndClearWorker() q, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered); if (leScanTimer) { disconnect(leScanTimer, &QTimer::timeout, - worker, &QWinRTBluetoothDeviceDiscoveryWorker::handleLeTimeout); + worker, &QWinRTBluetoothDeviceDiscoveryWorker::finishDiscovery); } worker.clear(); } diff --git a/src/bluetooth/qbluetoothlocaldevice_osx.mm b/src/bluetooth/qbluetoothlocaldevice_osx.mm index 8b22f809..52b7bba8 100644 --- a/src/bluetooth/qbluetoothlocaldevice_osx.mm +++ b/src/bluetooth/qbluetoothlocaldevice_osx.mm @@ -464,6 +464,8 @@ void QBluetoothLocalDevice::requestPairing(const QBluetoothAddress &address, Pai return; } + OSXBluetooth::qt_test_iobluetooth_runloop(); + return d_ptr->requestPairing(address, pairing); } diff --git a/src/bluetooth/qbluetoothserver_osx.mm b/src/bluetooth/qbluetoothserver_osx.mm index c72845bb..a1774d14 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; diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm b/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm index e1e73a0c..1d0cc7da 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm +++ b/src/bluetooth/qbluetoothservicediscoveryagent_osx.mm @@ -526,6 +526,8 @@ QBluetoothAddress QBluetoothServiceDiscoveryAgent::remoteAddress() const void QBluetoothServiceDiscoveryAgent::start(DiscoveryMode mode) { + OSXBluetooth::qt_test_iobluetooth_runloop(); + if (d_ptr->discoveryState() == QBluetoothServiceDiscoveryAgentPrivate::Inactive && d_ptr->error != InvalidBluetoothAdapterError) { diff --git a/src/bluetooth/qbluetoothsocket_osx.mm b/src/bluetooth/qbluetoothsocket_osx.mm index bf20220d..de7e2120 100644 --- a/src/bluetooth/qbluetoothsocket_osx.mm +++ b/src/bluetooth/qbluetoothsocket_osx.mm @@ -443,6 +443,8 @@ qint64 QBluetoothSocket::bytesToWrite() const void QBluetoothSocket::connectToService(const QBluetoothServiceInfo &service, OpenMode openMode) { + OSXBluetooth::qt_test_iobluetooth_runloop(); + // Report this problem early, potentially avoid device discovery: if (socketType() == QBluetoothServiceInfo::UnknownProtocol) { qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "cannot connect with 'UnknownProtocol' type"; @@ -480,6 +482,8 @@ void QBluetoothSocket::connectToService(const QBluetoothServiceInfo &service, Op void QBluetoothSocket::connectToService(const QBluetoothAddress &address, const QBluetoothUuid &uuid, OpenMode openMode) { + OSXBluetooth::qt_test_iobluetooth_runloop(); + // Report this problem early, avoid device discovery: if (socketType() == QBluetoothServiceInfo::UnknownProtocol) { qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "cannot connect with 'UnknownProtocol' type"; @@ -505,6 +509,8 @@ void QBluetoothSocket::connectToService(const QBluetoothAddress &address, const void QBluetoothSocket::connectToService(const QBluetoothAddress &address, quint16 port, OpenMode openMode) { + OSXBluetooth::qt_test_iobluetooth_runloop(); + if (socketType() == QBluetoothServiceInfo::UnknownProtocol) { qCWarning(QT_BT_OSX) << Q_FUNC_INFO << "cannot connect with 'UnknownProtocol' type"; d_ptr->errorString = QCoreApplication::translate(SOCKET, SOC_NETWORK_ERROR); @@ -571,6 +577,8 @@ void QBluetoothSocket::setSocketError(QBluetoothSocket::SocketError socketError) void QBluetoothSocket::doDeviceDiscovery(const QBluetoothServiceInfo &service, OpenMode openMode) { + OSXBluetooth::qt_test_iobluetooth_runloop(); + setSocketState(ServiceLookupState); if (d_ptr->discoveryAgent) diff --git a/src/nfc/doc/src/examples.qdoc b/src/nfc/doc/src/examples.qdoc index 7216c03c..7fb3e758 100644 --- a/src/nfc/doc/src/examples.qdoc +++ b/src/nfc/doc/src/examples.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -20,7 +20,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/nfc/doc/src/nfc-android.qdoc b/src/nfc/doc/src/nfc-android.qdoc index 7288b78a..d28f78ee 100644 --- a/src/nfc/doc/src/nfc-android.qdoc +++ b/src/nfc/doc/src/nfc-android.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2015 BasysKom GmbH -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -20,7 +20,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/nfc/doc/src/nfc-cpp.qdoc b/src/nfc/doc/src/nfc-cpp.qdoc index f007dcf3..00fb8aa5 100644 --- a/src/nfc/doc/src/nfc-cpp.qdoc +++ b/src/nfc/doc/src/nfc-cpp.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -20,7 +20,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/nfc/doc/src/nfc-index.qdoc b/src/nfc/doc/src/nfc-index.qdoc index a37ba293..c9acc92b 100644 --- a/src/nfc/doc/src/nfc-index.qdoc +++ b/src/nfc/doc/src/nfc-index.qdoc @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com> -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -12,8 +12,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -21,7 +21,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/nfc/doc/src/nfc-overview.qdoc b/src/nfc/doc/src/nfc-overview.qdoc index 9628ec49..6ac5c1dc 100644 --- a/src/nfc/doc/src/nfc-overview.qdoc +++ b/src/nfc/doc/src/nfc-overview.qdoc @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com> -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -12,8 +12,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -21,7 +21,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/nfc/doc/src/nfc-qml.qdoc b/src/nfc/doc/src/nfc-qml.qdoc index 3f96b39a..48df6d32 100644 --- a/src/nfc/doc/src/nfc-qml.qdoc +++ b/src/nfc/doc/src/nfc-qml.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Aaron McCarthy <mccarthy.aaron@gmail.com> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free @@ -20,7 +20,7 @@ ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/nfc/qndefnfcsmartposterrecord.cpp b/src/nfc/qndefnfcsmartposterrecord.cpp index 5f2de2cc..73f2cd21 100644 --- a/src/nfc/qndefnfcsmartposterrecord.cpp +++ b/src/nfc/qndefnfcsmartposterrecord.cpp @@ -141,12 +141,10 @@ void QNdefNfcSmartPosterRecord::setPayload(const QByteArray &payload) if (!payload.isEmpty()) { // Create new structure - QNdefMessage message = QNdefMessage::fromByteArray(payload); + const QNdefMessage message = QNdefMessage::fromByteArray(payload); // Iterate through all the records contained in the payload's message. - for (QList<QNdefRecord>::const_iterator iter = message.begin(); iter != message.end(); iter++) { - QNdefRecord record = *iter; - + for (const QNdefRecord& record : message) { // Title if (record.isRecordType<QNdefNfcTextRecord>()) { addTitleInternal(record); |