summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/bluez
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2016-06-09 15:00:36 +0200
committerAlex Blasche <alexander.blasche@theqtcompany.com>2016-06-09 15:00:43 +0200
commit6d9a7006e81fc9ef6140bfc62696d1b270aaae08 (patch)
treed7ce8d417f32ab73543740beab3cdee36b4fdfaf /src/bluetooth/bluez
parentbde54c522b76eeb933296aa1a9e159facbf8e529 (diff)
parent74916ede2ff34c2040db9cabbb5a6ee81442a7e8 (diff)
Merge remote-tracking branch 'gerrit/5.6' into 5.7
Diffstat (limited to 'src/bluetooth/bluez')
-rw-r--r--src/bluetooth/bluez/bluez5_helper.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/bluetooth/bluez/bluez5_helper.cpp b/src/bluetooth/bluez/bluez5_helper.cpp
index 2d431367..8871a872 100644
--- a/src/bluetooth/bluez/bluez5_helper.cpp
+++ b/src/bluetooth/bluez/bluez5_helper.cpp
@@ -266,8 +266,24 @@ void QtBluezDiscoveryManager::PropertiesChanged(const QString &interface,
&& d->references.contains(propIface->path())
&& changed_properties.contains(QStringLiteral("Discovering"))) {
bool isDiscovering = changed_properties.value(QStringLiteral("Discovering")).toBool();
- if (!isDiscovering)
- removeAdapterFromMonitoring(propIface->path());
+ if (!isDiscovering) {
+
+ /*
+ Once we stop the Discovering flag will switch a few ms later. This comes through this code
+ path. If a new device discovery is started while we are still
+ waiting for the flag change signal, then the new device discovery will be aborted prematurely.
+ To compensate we check whether there was renewed interest.
+ */
+
+ AdapterData *data = d->references[propIface->path()];
+ if (!data) {
+ removeAdapterFromMonitoring(propIface->path());
+ } else {
+ OrgBluezAdapter1Interface iface(QStringLiteral("org.bluez"), propIface->path(),
+ QDBusConnection::systemBus());
+ iface.StartDiscovery();
+ }
+ }
}
}