]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Do not disconnect all StorageAccess signals when unmounting
authorThomas Surrel <thomas.surrel@protonmail.com>
Tue, 13 Nov 2018 10:05:16 +0000 (11:05 +0100)
committerThomas Surrel <thomas.surrel@protonmail.com>
Sat, 17 Nov 2018 13:43:41 +0000 (14:43 +0100)
Summary:
The problem is caused by the fact device interfaces returned by
Solid (e.g. item->device().as<Solid::StorageAccess>()) are not
full objects, but only references/pointers to a per-device-object,
i.e. requesting the same interface for a device will return the same
address every time.

If the interface is used used in multiple places, calling disconnect
on the interface address disconnects the signals for all users.

BUG: 400992

Test Plan:
In Dolphin, mount a local partition (e.g. a Windows partition)
then unmount it (right click on it in Places, then Unmount).
Try to access it again by clicking on it in Places, we should
get access to it correctly.

Reviewers: #dolphin, #frameworks, bruns, elvisangelaccio

Reviewed By: #dolphin, elvisangelaccio

Subscribers: elvisangelaccio, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D16857

src/panels/places/placesitemmodel.cpp

index f7fe5587c7fa3cd2c5ce855982aad8e93fe83925..66bdbd57aa881f592bf75c2e1dd5138b44b00277 100644 (file)
@@ -471,7 +471,8 @@ void PlacesItemModel::slotStorageTearDownDone(Solid::ErrorType error, const QVar
     if (error && errorData.isValid()) {
         emit errorMessage(errorData.toString());
     }
-    m_deviceToTearDown->disconnect();
+    disconnect(m_deviceToTearDown, &Solid::StorageAccess::teardownDone,
+               this, &PlacesItemModel::slotStorageTearDownDone);
     m_deviceToTearDown = nullptr;
 }