summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-12-10 03:01:16 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-12-10 03:01:16 +0100
commit24892e65551f13b904b7b9043d225303a061671a (patch)
tree759f9967b5f90df09f7c51ed9728635a0b55ed0f /src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
parentad484cb1d763d5b422c287182aadb7b5479acdd5 (diff)
parent7d653dea516ed8e756814532dc4be742f5e0ce78 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp')
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
index 7dce9dae..243be3b2 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp
@@ -292,6 +292,17 @@ void QBluetoothDeviceDiscoveryAgentPrivate::startBluez5(QBluetoothDeviceDiscover
q, [this](const QString &path){
this->_q_discoveryInterrupted(path);
});
+ OrgFreedesktopDBusPropertiesInterface *prop = new OrgFreedesktopDBusPropertiesInterface(
+ QStringLiteral("org.bluez"), QStringLiteral(""), QDBusConnection::systemBus());
+ QObject::connect(prop, &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged,
+ q, [this](const QString &interface, const QVariantMap &changedProperties,
+ const QStringList &invalidatedProperties,
+ const QDBusMessage &signal) {
+ this->_q_PropertiesChanged(interface, signal.path(), changedProperties, invalidatedProperties);
+ });
+
+ // remember what we have to cleanup
+ propertyMonitors.append(prop);
// collect initial set of information
QDBusPendingReply<ManagedObjectList> reply = managerBluez5->GetManagedObjects();
@@ -476,17 +487,6 @@ void QBluetoothDeviceDiscoveryAgentPrivate::deviceFoundBluez5(const QString &dev
<< "RSSI" << deviceInfo.rssi()
<< "Num ManufacturerData" << deviceInfo.manufacturerData().size();
- OrgFreedesktopDBusPropertiesInterface *prop = new OrgFreedesktopDBusPropertiesInterface(
- QStringLiteral("org.bluez"), devicePath, QDBusConnection::systemBus(), q);
- QObject::connect(prop, &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged,
- q, [this](const QString &interface, const QVariantMap &changedProperties,
- const QStringList &invalidatedProperties) {
- this->_q_PropertiesChanged(interface, changedProperties, invalidatedProperties);
- });
-
- // remember what we have to cleanup
- propertyMonitors.append(prop);
-
// Cache the properties so we do not have to access dbus every time to get a value
devicesProperties[devicePath] = properties;
@@ -641,6 +641,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_discoveryInterrupted(const QStrin
}
void QBluetoothDeviceDiscoveryAgentPrivate::_q_PropertiesChanged(const QString &interface,
+ const QString &path,
const QVariantMap &changed_properties,
const QStringList &invalidated_properties)
{
@@ -648,12 +649,6 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_PropertiesChanged(const QString &
if (interface != QStringLiteral("org.bluez.Device1"))
return;
- OrgFreedesktopDBusPropertiesInterface *props =
- qobject_cast<OrgFreedesktopDBusPropertiesInterface *>(q->sender());
- if (!props)
- return;
-
- const QString path = props->path();
if (!devicesProperties.contains(path))
return;