┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntti Savolainen <[email protected]>2026-04-18 09:31:32 +0000
committerMéven Car <[email protected]>2026-04-18 09:31:32 +0000
commit7d81e3092a85b77d575d2519d97c578365080e0e (patch)
tree336cf79c2a9934abc25afdd9a096707b8634e47a
parent0b0bf9d562af7de9f2d223a55e4a496ca2c6a3e8 (diff)
dolphincontextmenu: move "Empty Trash" to where you expect destructive actions to be
"Empty Trash" has caused me to delete files that I've wanted to restore. This moves the position to where you expect them to be. To my understanding the standard order in the context menu is: Creation operations Visual adjustments Destructive operations Misc. Settings | Before | After | Restore for comparison | |-|-|-| | ![image](/uploads/16e8bc66d3123be2f6ab598972d8be3c/image.png){width=185 height=144}| ![image](/uploads/fbcded1023c7133099b2dcddbd6c7bc3/image.png){width=225 height=161} | ![image](/uploads/8bdb39e0e21a9128204181d38acb0ed6/image.png){width=270 height=159} | BUG: 518713
-rw-r--r--src/dolphincontextmenu.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index 31c353ee3..796c723ed 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -121,6 +121,18 @@ bool DolphinContextMenu::eventFilter(QObject *object, QEvent *event)
void DolphinContextMenu::addTrashContextMenu()
{
+ // Insert 'Sort By' and 'View Mode'
+ if (ContextMenuSettings::showSortBy()) {
+ addAction(m_mainWindow->actionCollection()->action(QStringLiteral("sort")));
+ }
+ if (ContextMenuSettings::showViewMode()) {
+ addAction(m_mainWindow->actionCollection()->action(QStringLiteral("view_mode")));
+ }
+
+ if (ContextMenuSettings::showSortBy() || ContextMenuSettings::showViewMode()) {
+ addSeparator();
+ }
+
Q_ASSERT(m_context & TrashContext);
QAction *emptyTrashAction = addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18nc("@action:inmenu", "Empty Trash"), this, [this]() {
@@ -132,17 +144,6 @@ void DolphinContextMenu::addTrashContextMenu()
emptyTrashAction->setEnabled(!isEmpty);
});
- // Insert 'Sort By' and 'View Mode'
- if (ContextMenuSettings::showSortBy() || ContextMenuSettings::showViewMode()) {
- addSeparator();
- }
- if (ContextMenuSettings::showSortBy()) {
- addAction(m_mainWindow->actionCollection()->action(QStringLiteral("sort")));
- }
- if (ContextMenuSettings::showViewMode()) {
- addAction(m_mainWindow->actionCollection()->action(QStringLiteral("view_mode")));
- }
-
addSeparator();
auto *configureTrashAction = new QAction(QIcon::fromTheme(QStringLiteral("configure")), i18nc("@action:inmenu", "Configure Trash…"), this);