diff options
| author | Miklos Marton <[email protected]> | 2017-10-12 23:17:51 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2017-10-12 23:21:49 +0200 |
| commit | bd47eb2e6d80315115bb3f58987162fcb4911b10 (patch) | |
| tree | d51172264a047f02e235cc2e78371330336e4792 /src/panels/places/placespanel.cpp | |
| parent | 1ad3b7775ec7388352d3a02c704062baa5d0aca3 (diff) | |
Don't block unmounting when terminal panel's cwd is the mountpoint
When unmounting a removable media Dolphin checks if there are
some files open on the device before performing the unmount.
If the terminal window in dolphin is open and the to be unmounted path is open,
the unmount process will be blocked.
This patch sets the terminal window current path to the home directory upon unmount request
if the terminal directory is set to the mount path.
The unmount request could came from two sources:
The user could hit right click on the media in the dolphin's places panel and hit unmount.
The user could request an unmount from the indicator applet
This patch was originally written by Arjun AK for the kdelibs4 version
of Dolphin: https://git.reviewboard.kde.org/r/121613/
BUG: 158264
FIXED-IN: 17.11.80
Differential Revision: https://phabricator.kde.org/D7847
Diffstat (limited to 'src/panels/places/placespanel.cpp')
| -rw-r--r-- | src/panels/places/placespanel.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 19a17be08..0ce6d69a5 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -72,6 +72,11 @@ PlacesPanel::~PlacesPanel() { } +void PlacesPanel::proceedWithTearDown() +{ + m_model->proceedWithTearDown(); +} + bool PlacesPanel::urlChanged() { if (!url().isValid() || url().scheme().contains(QStringLiteral("search"))) { @@ -110,6 +115,10 @@ void PlacesPanel::showEvent(QShowEvent* event) m_model->setGroupedSorting(true); connect(m_model, &PlacesItemModel::errorMessage, this, &PlacesPanel::errorMessage); + connect(m_model, &PlacesItemModel::storageTearDownRequested, + this, &PlacesPanel::storageTearDownRequested); + connect(m_model, &PlacesItemModel::storageTearDownExternallyRequested, + this, &PlacesPanel::storageTearDownExternallyRequested); m_view = new PlacesView(); m_view->setWidgetCreator(new KItemListWidgetCreator<PlacesItemListWidget>()); @@ -241,7 +250,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) // emit the slotItemMiddleClicked signal, because of Qt::MiddleButton. triggerItem(index, Qt::MiddleButton); } else if (action == teardownAction) { - m_model->requestTeardown(index); + m_model->requestTearDown(index); } else if (action == ejectAction) { m_model->requestEject(index); } |
