diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-06-09 15:00:36 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-06-09 15:00:43 +0200 |
commit | 6d9a7006e81fc9ef6140bfc62696d1b270aaae08 (patch) | |
tree | d7ce8d417f32ab73543740beab3cdee36b4fdfaf /src/bluetooth/bluez | |
parent | bde54c522b76eeb933296aa1a9e159facbf8e529 (diff) | |
parent | 74916ede2ff34c2040db9cabbb5a6ee81442a7e8 (diff) |
Merge remote-tracking branch 'gerrit/5.6' into 5.7
Change-Id: Id8dffff9bb75db396aabf6da2a3acb78505a6476
Diffstat (limited to 'src/bluetooth/bluez')
-rw-r--r-- | src/bluetooth/bluez/bluez5_helper.cpp | 20 |
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(); + } + } } } |