summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2017-07-04 08:16:34 +0200
committerOliver Wolff <oliver.wolff@qt.io>2017-07-04 12:11:56 +0000
commitb0089abb05e6f60cc252068be1ba40be32e29bd3 (patch)
tree1f97e8ec5ed7352bf0359627128da5b0b083fd48 /src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
parentb211fa43a050d63259e5f73ffd68aaa82a1c634b (diff)
winrt: Do not emit canceled in timeout case in device discovery
canceled should only be emitted if stop was used to abort a running device discovery. A timeout happening has to cause a normal finished. Change-Id: I1072c14a44b84da0cb93420cf7344b8bc56b523e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp')
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
index d8d68d4b..1aaaf0a4 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
@@ -109,7 +109,6 @@ public slots:
Q_SIGNALS:
void deviceFound(const QBluetoothDeviceInfo &info);
void scanFinished();
- void scanCanceled();
public:
quint8 requestedModes;
@@ -250,10 +249,7 @@ void QWinRTBluetoothDeviceDiscoveryWorker::setupLEDeviceWatcher()
void QWinRTBluetoothDeviceDiscoveryWorker::handleLeTimeout()
{
- if (m_pendingPairedDevices == 0)
- emit scanFinished();
- else
- emit scanCanceled();
+ emit scanFinished();
deleteLater();
}
@@ -552,8 +548,6 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start(QBluetoothDeviceDiscoveryAgent
this, &QBluetoothDeviceDiscoveryAgentPrivate::registerDevice);
connect(worker, &QWinRTBluetoothDeviceDiscoveryWorker::scanFinished,
this, &QBluetoothDeviceDiscoveryAgentPrivate::onScanFinished);
- connect(worker, &QWinRTBluetoothDeviceDiscoveryWorker::scanCanceled,
- this, &QBluetoothDeviceDiscoveryAgentPrivate::onScanCanceled);
worker->start();
if (lowEnergySearchTimeout > 0 && methods & QBluetoothDeviceDiscoveryAgent::LowEnergyMethod) { // otherwise no timeout and stop() required
@@ -613,21 +607,12 @@ void QBluetoothDeviceDiscoveryAgentPrivate::onScanFinished()
emit q->finished();
}
-void QBluetoothDeviceDiscoveryAgentPrivate::onScanCanceled()
-{
- Q_Q(QBluetoothDeviceDiscoveryAgent);
- disconnectAndClearWorker();
- emit q->canceled();
-}
-
void QBluetoothDeviceDiscoveryAgentPrivate::disconnectAndClearWorker()
{
Q_Q(QBluetoothDeviceDiscoveryAgent);
if (!worker)
return;
- disconnect(worker, &QWinRTBluetoothDeviceDiscoveryWorker::scanCanceled,
- this, &QBluetoothDeviceDiscoveryAgentPrivate::onScanCanceled);
disconnect(worker, &QWinRTBluetoothDeviceDiscoveryWorker::scanFinished,
this, &QBluetoothDeviceDiscoveryAgentPrivate::onScanFinished);
disconnect(worker, &QWinRTBluetoothDeviceDiscoveryWorker::deviceFound,