diff options
| author | Nate Graham <[email protected]> | 2020-10-13 11:51:59 -0600 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2020-10-23 17:00:09 +0000 |
| commit | ae1d441dacef7e52984201abdc9a918ce060021c (patch) | |
| tree | a8ebd2496dec8843025cccb36ac0696c8f9ab66b /src/panels | |
| parent | 1501825d447bf0d316750368d8579a95a38ce537 (diff) | |
Show home folder if needed after unmounting mounted disk
Right now, when you unmount a device that any active view containers are
displaying, nothing in the view changes. As a result, it's possible to
try to navigate to files or folders in that view, which cannot be done
because the disk that the files or folders are located on has been
unmounted!
With this commit, we detect that case and switch the view containers
to show the home folder after the disk whose contents they are displaying
gets unmounted.
BUG: 158934
FIXED-IN: 20.12
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/places/placesitemmodel.cpp | 3 | ||||
| -rw-r--r-- | src/panels/places/placesitemmodel.h | 1 | ||||
| -rw-r--r-- | src/panels/places/placespanel.cpp | 2 | ||||
| -rw-r--r-- | src/panels/places/placespanel.h | 1 |
4 files changed, 7 insertions, 0 deletions
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index de858389b..c9f1c8365 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -473,6 +473,9 @@ void PlacesItemModel::slotStorageTearDownDone(Solid::ErrorType error, const QVar } else { emit errorMessage(errorData.toString()); } + } else { + // No error; it must have been unmounted successfully + emit storageTearDownSuccessful(); } disconnect(m_deviceToTearDown, &Solid::StorageAccess::teardownDone, this, &PlacesItemModel::slotStorageTearDownDone); diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h index 91f017cec..2b1f3bc14 100644 --- a/src/panels/places/placesitemmodel.h +++ b/src/panels/places/placesitemmodel.h @@ -130,6 +130,7 @@ signals: void storageSetupDone(int index, bool success); void storageTearDownRequested(const QString& mountPath); void storageTearDownExternallyRequested(const QString& mountPath); + void storageTearDownSuccessful(); protected: void onItemInserted(int index) override; diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 413d346b6..2e1d09e6b 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -104,6 +104,8 @@ void PlacesPanel::showEvent(QShowEvent* event) this, &PlacesPanel::storageTearDownRequested); connect(m_model, &PlacesItemModel::storageTearDownExternallyRequested, this, &PlacesPanel::storageTearDownExternallyRequested); + connect(m_model, &PlacesItemModel::storageTearDownSuccessful, + this, &PlacesPanel::storageTearDownSuccessful); m_view = new PlacesView(); m_view->setWidgetCreator(new KItemListWidgetCreator<PlacesItemListWidget>()); diff --git a/src/panels/places/placespanel.h b/src/panels/places/placespanel.h index 8ea4d0831..38bfa4c53 100644 --- a/src/panels/places/placespanel.h +++ b/src/panels/places/placespanel.h @@ -37,6 +37,7 @@ signals: void storageTearDownRequested(const QString& mountPath); void storageTearDownExternallyRequested(const QString& mountPath); void showHiddenEntriesChanged(bool shown); + void storageTearDownSuccessful(); protected: bool urlChanged() override; |
