diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-12-10 03:01:16 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-12-10 03:01:16 +0100 |
commit | 24892e65551f13b904b7b9043d225303a061671a (patch) | |
tree | 759f9967b5f90df09f7c51ed9728635a0b55ed0f /src/bluetooth/qlowenergycontroller_bluezdbus.cpp | |
parent | ad484cb1d763d5b422c287182aadb7b5479acdd5 (diff) | |
parent | 7d653dea516ed8e756814532dc4be742f5e0ce78 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I6a7635841698e6de98d94ac8b21a1764f01569e2
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_bluezdbus.cpp')
-rw-r--r-- | src/bluetooth/qlowenergycontroller_bluezdbus.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bluetooth/qlowenergycontroller_bluezdbus.cpp b/src/bluetooth/qlowenergycontroller_bluezdbus.cpp index 2a0fafdf..5dde8774 100644 --- a/src/bluetooth/qlowenergycontroller_bluezdbus.cpp +++ b/src/bluetooth/qlowenergycontroller_bluezdbus.cpp @@ -112,6 +112,23 @@ void QLowEnergyControllerPrivateBluezDBus::devicePropertiesChanged( } } } + + if (changedProperties.contains(QStringLiteral("UUIDs"))) { + const QStringList newUuidStringList = changedProperties.value(QStringLiteral("UUIDs")).toStringList(); + QVector<QBluetoothUuid> newUuidList; + for (const QString &uuidString : newUuidStringList) + newUuidList.append(QBluetoothUuid(uuidString)); + + for (const QBluetoothUuid &uuid : serviceList.keys()) { + if (!newUuidList.contains(uuid)) { + qCDebug(QT_BT_BLUEZ) << __func__ << "Service" << uuid << "has been removed"; + QSharedPointer<QLowEnergyServicePrivate> service = serviceList.take(uuid); + service->setController(nullptr); + dbusServices.remove(uuid); + } + } + } + } else if (interface == QStringLiteral("org.bluez.Battery1")) { qCDebug(QT_BT_BLUEZ) << "######" << interface << changedProperties; if (changedProperties.contains(QStringLiteral("Percentage"))) { |