diff options
author | Liang Qi <liang.qi@qt.io> | 2017-10-30 08:43:34 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-10-30 08:43:34 +0100 |
commit | 3c29e286c7e79a3704a849e05e47d17d6a7cf62c (patch) | |
tree | c1b9a0d03714f22497acce77c1e7efe0714ff190 /src | |
parent | 013ad0570844975cd5c72a77d1cfefa30c3ea656 (diff) | |
parent | 6029bad7d1007aecd155985ba13d6c23a01015b8 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: Iaa053dcb125490ee1e83d7e27cb75d4171297b9f
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/bluez/remotedevicemanager.cpp | 5 | ||||
-rw-r--r-- | src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp | 16 | ||||
-rw-r--r-- | src/bluetooth/doc/snippets/doc_src_qtbluetooth.qml | 16 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_p.h | 5 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothserver_p.h | 2 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent_p.h | 4 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothsocket_p.h | 2 | ||||
-rw-r--r-- | src/bluetooth/qlowenergycontroller_bluez.cpp | 15 | ||||
-rw-r--r-- | src/bluetooth/qlowenergycontroller_winrt.cpp | 1 | ||||
-rw-r--r-- | src/nfc/doc/snippets/doc_src_qtnfc.cpp | 14 | ||||
-rw-r--r-- | src/nfc/doc/snippets/doc_src_qtnfc.qml | 16 | ||||
-rw-r--r-- | src/nfc/doc/snippets/foorecord.cpp | 16 | ||||
-rw-r--r-- | src/nfc/doc/snippets/foorecord.h | 16 | ||||
-rw-r--r-- | src/nfc/doc/snippets/main.cpp | 16 | ||||
-rw-r--r-- | src/nfc/doc/snippets/nfc.cpp | 16 | ||||
-rw-r--r-- | src/nfc/qnearfieldtarget_android.cpp | 3 |
16 files changed, 135 insertions, 28 deletions
diff --git a/src/bluetooth/bluez/remotedevicemanager.cpp b/src/bluetooth/bluez/remotedevicemanager.cpp index f63b21e6..5d17d571 100644 --- a/src/bluetooth/bluez/remotedevicemanager.cpp +++ b/src/bluetooth/bluez/remotedevicemanager.cpp @@ -106,6 +106,7 @@ void RemoteDeviceManager::prepareNextJob() jobQueue.pop_front(); jobInProgress = false; + qDebug(QT_BT_BLUEZ) << "RemoteDeviceManager job queue status:" << jobQueue.empty(); if (jobQueue.empty()) emit finished(); else @@ -163,8 +164,10 @@ void RemoteDeviceManager::disconnectDevice(const QBluetoothAddress &remote) } } - if (!jobStarted) + if (!jobStarted) { + qDebug(QT_BT_BLUEZ) << "RemoteDeviceManager JobDisconnectDevice failed"; QTimer::singleShot(0, this, [this](){ prepareNextJob(); }); + } } QT_END_NAMESPACE diff --git a/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp b/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp index 1eec9206..2e28c3f5 100644 --- a/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp +++ b/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** 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. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/bluetooth/doc/snippets/doc_src_qtbluetooth.qml b/src/bluetooth/doc/snippets/doc_src_qtbluetooth.qml index fcafbd53..efed6cc7 100644 --- a/src/bluetooth/doc/snippets/doc_src_qtbluetooth.qml +++ b/src/bluetooth/doc/snippets/doc_src_qtbluetooth.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** 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. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h index 243d7fd2..15758195 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h @@ -78,6 +78,11 @@ class QDBusVariant; QT_END_NAMESPACE #endif +#ifdef QT_WINRT_BLUETOOTH +#include <QtCore/QPointer> +#include <QtCore/QTimer> +#endif + QT_BEGIN_NAMESPACE #ifdef QT_WINRT_BLUETOOTH diff --git a/src/bluetooth/qbluetoothserver_p.h b/src/bluetooth/qbluetoothserver_p.h index 4abadc72..9c414cdb 100644 --- a/src/bluetooth/qbluetoothserver_p.h +++ b/src/bluetooth/qbluetoothserver_p.h @@ -70,6 +70,8 @@ class ServerAcceptanceThread; #endif #ifdef QT_WINRT_BLUETOOTH +#include <QtCore/QMutex> + #include <wrl.h> // No forward declares because QBluetoothServerPrivate::listener does not work with them #include <windows.networking.sockets.h> diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_p.h b/src/bluetooth/qbluetoothservicediscoveryagent_p.h index c4ea20a9..2a57c531 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent_p.h +++ b/src/bluetooth/qbluetoothservicediscoveryagent_p.h @@ -72,6 +72,10 @@ class QXmlStreamReader; QT_END_NAMESPACE #endif +#ifdef QT_WINRT_BLUETOOTH +#include <QtCore/QPointer> +#endif + QT_BEGIN_NAMESPACE class QBluetoothDeviceDiscoveryAgent; diff --git a/src/bluetooth/qbluetoothsocket_p.h b/src/bluetooth/qbluetoothsocket_p.h index 907acbe2..ae3c6182 100644 --- a/src/bluetooth/qbluetoothsocket_p.h +++ b/src/bluetooth/qbluetoothsocket_p.h @@ -62,6 +62,8 @@ class WorkerThread; #endif #ifdef QT_WINRT_BLUETOOTH +#include <QtCore/QMutex> + #include <wrl.h> namespace ABI { diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp index ca3f7760..003aff38 100644 --- a/src/bluetooth/qlowenergycontroller_bluez.cpp +++ b/src/bluetooth/qlowenergycontroller_bluez.cpp @@ -527,8 +527,10 @@ void QLowEnergyControllerPrivate::connectToDevice() } setState(QLowEnergyController::ConnectingState); - if (l2cpSocket) + if (l2cpSocket) { delete l2cpSocket; + l2cpSocket = nullptr; + } createServicesForCentralIfRequired(); @@ -581,6 +583,7 @@ void QLowEnergyControllerPrivate::activeConnectionTerminationDone() qCWarning(QT_BT_BLUEZ) << "Cannot close pending external BTLE connections. Aborting connect attempt"; setError(QLowEnergyController::ConnectionError); setState(QLowEnergyController::UnconnectedState); + l2cpDisconnected(); return; } else { establishL2cpClientSocket(); @@ -726,8 +729,16 @@ void QLowEnergyControllerPrivate::l2cpConnected() void QLowEnergyControllerPrivate::disconnectFromDevice() { setState(QLowEnergyController::ClosingState); - l2cpSocket->close(); + if (l2cpSocket) + l2cpSocket->close(); resetController(); + + // this may happen when RemoteDeviceManager::JobType::JobDisconnectDevice + // is pending. + if (!l2cpSocket) { + qWarning(QT_BT_BLUEZ) << "Unexpected closure of device. Cleaning up internal states."; + l2cpDisconnected(); + } } void QLowEnergyControllerPrivate::l2cpDisconnected() diff --git a/src/bluetooth/qlowenergycontroller_winrt.cpp b/src/bluetooth/qlowenergycontroller_winrt.cpp index 62b8a9d3..838d563d 100644 --- a/src/bluetooth/qlowenergycontroller_winrt.cpp +++ b/src/bluetooth/qlowenergycontroller_winrt.cpp @@ -43,6 +43,7 @@ #define Q_OS_WINRT #endif #include <QtCore/qfunctions_winrt.h> +#include <QtCore/QtEndian> #include <QtCore/QLoggingCategory> #include <private/qeventdispatcher_winrt_p.h> diff --git a/src/nfc/doc/snippets/doc_src_qtnfc.cpp b/src/nfc/doc/snippets/doc_src_qtnfc.cpp index f4d7f91a..760d65fd 100644 --- a/src/nfc/doc/snippets/doc_src_qtnfc.cpp +++ b/src/nfc/doc/snippets/doc_src_qtnfc.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** ** 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. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/nfc/doc/snippets/doc_src_qtnfc.qml b/src/nfc/doc/snippets/doc_src_qtnfc.qml index 65efee56..78f7f83d 100644 --- a/src/nfc/doc/snippets/doc_src_qtnfc.qml +++ b/src/nfc/doc/snippets/doc_src_qtnfc.qml @@ -1,13 +1,23 @@ /**************************************************************************** ** ** 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. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/nfc/doc/snippets/foorecord.cpp b/src/nfc/doc/snippets/foorecord.cpp index 14a83af3..4fecd712 100644 --- a/src/nfc/doc/snippets/foorecord.cpp +++ b/src/nfc/doc/snippets/foorecord.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** 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. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/nfc/doc/snippets/foorecord.h b/src/nfc/doc/snippets/foorecord.h index e8c130e4..c2501287 100644 --- a/src/nfc/doc/snippets/foorecord.h +++ b/src/nfc/doc/snippets/foorecord.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** 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. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/nfc/doc/snippets/main.cpp b/src/nfc/doc/snippets/main.cpp index 09d07b02..6f2bb0d7 100644 --- a/src/nfc/doc/snippets/main.cpp +++ b/src/nfc/doc/snippets/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** 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. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/nfc/doc/snippets/nfc.cpp b/src/nfc/doc/snippets/nfc.cpp index eb7ef989..82297682 100644 --- a/src/nfc/doc/snippets/nfc.cpp +++ b/src/nfc/doc/snippets/nfc.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** 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. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** 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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/src/nfc/qnearfieldtarget_android.cpp b/src/nfc/qnearfieldtarget_android.cpp index 50c5c1b3..dcdc872d 100644 --- a/src/nfc/qnearfieldtarget_android.cpp +++ b/src/nfc/qnearfieldtarget_android.cpp @@ -297,7 +297,6 @@ QNearFieldTarget::RequestId NearFieldTarget::writeNdefMessages(const QList<QNdef QAndroidJniEnvironment env; const char *writeMethod; - QAndroidJniObject tagTechnology; if (!setTagTechnology({NDEFFORMATABLETECHNOLOGY, NDEFTECHNOLOGY})) return QNearFieldTarget::RequestId(); @@ -331,7 +330,7 @@ QNearFieldTarget::RequestId NearFieldTarget::writeNdefMessages(const QList<QNdef } // Writing - tagTechnology.callMethod<void>(writeMethod, "(Landroid/nfc/NdefMessage;)V", jmessage.object<jobject>()); + m_tagTech.callMethod<void>(writeMethod, "(Landroid/nfc/NdefMessage;)V", jmessage.object<jobject>()); if (catchJavaExceptions()) { QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QNearFieldTarget::Error, QNearFieldTarget::NdefWriteError), |