Paste P202

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on May 1 2018, 8:36 PM.
diff --git a/src/solid/devices/backends/udisks2/udisksdevice.cpp b/src/solid/devices/backends/udisks2/udisksdevice.cpp
index f3fdfff..0df32be 100644
--- a/src/solid/devices/backends/udisks2/udisksdevice.cpp
+++ b/src/solid/devices/backends/udisks2/udisksdevice.cpp
@@ -157,6 +157,13 @@ QStringList Device::interfaces() const
return QStringList();
}
+void Device::invalidateCache()
+{
+ if (m_backend) {
+ return m_backend->invalidateProperties();
+ }
+}
+
QObject *Device::createDeviceInterface(const Solid::DeviceInterface::Type &type)
{
if (!queryDeviceInterface(type)) {
diff --git a/src/solid/devices/backends/udisks2/udisksdevice.h b/src/solid/devices/backends/udisks2/udisksdevice.h
index 147d554..1492564 100644
--- a/src/solid/devices/backends/udisks2/udisksdevice.h
+++ b/src/solid/devices/backends/udisks2/udisksdevice.h
@@ -61,6 +61,7 @@ public:
QVariant prop(const QString &key) const;
bool propertyExists(const QString &key) const;
QVariantMap allProperties() const;
+ void invalidateCache();
bool hasInterface(const QString &name) const;
QStringList interfaces() const;
diff --git a/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp b/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
index 7db2263..d08f35d 100644
--- a/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
+++ b/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
@@ -166,6 +166,7 @@ void StorageAccess::slotDBusReply(const QDBusMessage & /*reply*/)
mount();
} else { // Don't broadcast setupDone unless the setup is really done. (Fix kde#271156)
m_setupInProgress = false;
+ m_device->invalidateCache();
m_device->broadcastActionDone("setup");
checkAccessibility();
@@ -191,6 +192,7 @@ void StorageAccess::slotDBusReply(const QDBusMessage & /*reply*/)
}
m_teardownInProgress = false;
+ m_device->invalidateCache();
m_device->broadcastActionDone("teardown");
checkAccessibility();
@@ -227,9 +229,8 @@ void StorageAccess::slotSetupDone(int error, const QString &errorString)
{
m_setupInProgress = false;
//qDebug() << "SETUP DONE:" << m_device->udi();
- emit setupDone(static_cast<Solid::ErrorType>(error), errorString, m_device->udi());
-
checkAccessibility();
+ emit setupDone(static_cast<Solid::ErrorType>(error), errorString, m_device->udi());
}
void StorageAccess::slotTeardownRequested()
@@ -241,9 +242,8 @@ void StorageAccess::slotTeardownRequested()
void StorageAccess::slotTeardownDone(int error, const QString &errorString)
{
m_teardownInProgress = false;
- emit teardownDone(static_cast<Solid::ErrorType>(error), errorString, m_device->udi());
-
checkAccessibility();
+ emit teardownDone(static_cast<Solid::ErrorType>(error), errorString, m_device->udi());
}
bool StorageAccess::mount()
davidedmundson edited the content of this paste. (Show Details)May 1 2018, 8:36 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.
davidedmundson updated the paste's language from autodetect to autodetect.