diff options
| author | Tigran Gabrielyan <[email protected]> | 2019-03-24 11:30:27 -0600 |
|---|---|---|
| committer | Nate Graham <[email protected]> | 2019-03-24 11:31:13 -0600 |
| commit | 1eaf5d3e0362f8d39655e973bcd29813ae98652b (patch) | |
| tree | dcdc5b51c69500139f2d8b7019ce523df9bf2296 /src/panels/places | |
| parent | d7277e47a6b84f20957e829d378b389df668fdc6 (diff) | |
Move Safely Remove down in places context menu
Summary: BUG: 405620
Reviewers: #dolphin, ngraham, elvisangelaccio
Reviewed By: #dolphin, ngraham, elvisangelaccio
Subscribers: elvisangelaccio, ngraham, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D19950
Diffstat (limited to 'src/panels/places')
| -rw-r--r-- | src/panels/places/placespanel.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index d0dbcce88..224eb0c64 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -175,6 +175,22 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) const bool isDevice = !item->udi().isEmpty(); const bool isTrash = (item->url().scheme() == QLatin1String("trash")); + if (isTrash) { + emptyTrashAction = menu.addAction(QIcon::fromTheme(QStringLiteral("trash-empty")), i18nc("@action:inmenu", "Empty Trash")); + emptyTrashAction->setEnabled(item->icon() == QLatin1String("user-trash-full")); + menu.addSeparator(); + } + + QAction* openInNewWindowAction = menu.addAction(QIcon::fromTheme(QStringLiteral("window-new")), i18nc("@item:inmenu", "Open in New Window")); + QAction* openInNewTabAction = menu.addAction(QIcon::fromTheme(QStringLiteral("tab-new")), i18nc("@item:inmenu", "Open in New Tab")); + QAction* propertiesAction = nullptr; + if (item->url().isLocalFile()) { + propertiesAction = menu.addAction(QIcon::fromTheme(QStringLiteral("document-properties")), i18nc("@action:inmenu", "Properties")); + } + if (!isDevice && !isTrash) { + menu.addSeparator(); + } + if (isDevice) { ejectAction = m_model->ejectAction(index); if (ejectAction) { @@ -205,22 +221,6 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) if (teardownAction || ejectAction || mountAction) { menu.addSeparator(); } - } else { - if (isTrash) { - emptyTrashAction = menu.addAction(QIcon::fromTheme(QStringLiteral("trash-empty")), i18nc("@action:inmenu", "Empty Trash")); - emptyTrashAction->setEnabled(item->icon() == QLatin1String("user-trash-full")); - menu.addSeparator(); - } - } - - QAction* openInNewWindowAction = menu.addAction(QIcon::fromTheme(QStringLiteral("window-new")), i18nc("@item:inmenu", "Open in New Window")); - QAction* openInNewTabAction = menu.addAction(QIcon::fromTheme(QStringLiteral("tab-new")), i18nc("@item:inmenu", "Open in New Tab")); - QAction* propertiesAction = nullptr; - if (item->url().isLocalFile()) { - propertiesAction = menu.addAction(QIcon::fromTheme(QStringLiteral("document-properties")), i18nc("@action:inmenu", "Properties")); - } - if (!isDevice && !isTrash) { - menu.addSeparator(); } if (!isDevice) { |
