┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphincontextmenu.cpp
diff options
context:
space:
mode:
authorThomas Surrel <[email protected]>2018-11-19 14:08:19 +0100
committerThomas Surrel <[email protected]>2018-11-19 16:12:03 +0100
commit1340e98548753f0c8e087b2f80c55c2cf6e9acd3 (patch)
tree0ee06a417b6eff508e041b38a806993c10922b49 /src/dolphincontextmenu.cpp
parent1f162f181c9f47d8798a65d9869d99eab287d373 (diff)
Show the Delete context menu entry even when disabled
Summary: This is consistent with the HIG, and the 'Rename' entry in the context menu already behaves like that. Test Plan: Right click on /home. The context menu should contained the 'Delete' entry, but it should be disabled. Reviewers: #dolphin, #vdg, ngraham Reviewed By: #dolphin, #vdg, ngraham Subscribers: ngraham, romangg, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D17012
Diffstat (limited to 'src/dolphincontextmenu.cpp')
-rw-r--r--src/dolphincontextmenu.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index a521551e5..9d7972b9f 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -421,26 +421,24 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties&
addAction(collection->action(KStandardAction::name(KStandardAction::RenameFile)));
// Insert 'Move to Trash' and/or 'Delete'
- if (properties.supportsDeleting()) {
- const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) ||
- !properties.isLocal());
- const bool showMoveToTrashAction = (properties.isLocal() &&
- properties.supportsMoving());
+ const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) ||
+ !properties.isLocal());
+ const bool showMoveToTrashAction = (properties.isLocal() &&
+ properties.supportsMoving());
- if (showDeleteAction && showMoveToTrashAction) {
- delete m_removeAction;
- m_removeAction = nullptr;
- addAction(m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::MoveToTrash)));
- addAction(m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile)));
- } else if (showDeleteAction && !showMoveToTrashAction) {
- addAction(m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile)));
- } else {
- if (!m_removeAction) {
- m_removeAction = new DolphinRemoveAction(this, m_mainWindow->actionCollection());
- }
- addAction(m_removeAction);
- m_removeAction->update();
+ if (showDeleteAction && showMoveToTrashAction) {
+ delete m_removeAction;
+ m_removeAction = nullptr;
+ addAction(m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::MoveToTrash)));
+ addAction(m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile)));
+ } else if (showDeleteAction && !showMoveToTrashAction) {
+ addAction(m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile)));
+ } else {
+ if (!m_removeAction) {
+ m_removeAction = new DolphinRemoveAction(this, m_mainWindow->actionCollection());
}
+ addAction(m_removeAction);
+ m_removeAction->update();
}
}