You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kf5-solid/0004-Invalidate-property-ca...

44 lines
1.4 KiB

From 796dea6c044030bc2c02bcfcc967e1fffe9fa276 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Thu, 12 Apr 2018 00:12:54 +0200
Subject: [PATCH 4/5] Invalidate property cache when an interface is removed
Summary:
As we do not know which property belongs to which interface we have to
drop the whole cache whenever one or multiples interface are removed.
Test Plan:
make
solid-hardware5 list details
solid-hardware5 listen
Reviewers: #frameworks, broulik
Reviewed By: broulik
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D12126
---
src/solid/devices/backends/udisks2/udisksdevicebackend.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/solid/devices/backends/udisks2/udisksdevicebackend.cpp b/src/solid/devices/backends/udisks2/udisksdevicebackend.cpp
index def7dff..2349d54 100644
--- a/src/solid/devices/backends/udisks2/udisksdevicebackend.cpp
+++ b/src/solid/devices/backends/udisks2/udisksdevicebackend.cpp
@@ -247,4 +247,10 @@ void DeviceBackend::slotInterfacesRemoved(const QDBusObjectPath &object_path, co
Q_FOREACH (const QString &iface, interfaces) {
m_interfaces.removeAll(iface);
}
+
+ // We don't know which property belongs to which interface, so remove all
+ m_propertyCache.clear();
+ if (!m_interfaces.isEmpty()) {
+ allProperties();
+ }
}
--
2.14.3