[system/dolphin] src: Show trash specific context menu when searching the trash
Leopold Luley <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 0f7823b0dc668b421d0270d61d5eb4c2e528e405 by Leopold Luley.
Committed on 18/07/2026 at 19:27.
Pushed by meven into branch 'master'.
Show trash specific context menu when searching the trash
BUG: 379991
M +7 -1 src/dolphincontextmenu.cpp
https://invent.kde.org/system/dolphin/-/commit/0f7823b0dc668b421d0270d61d5eb4c2e528e405
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index 796c723edb..2a120662a4 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -14,6 +14,7 @@
#include "dolphinremoveaction.h"
#include "dolphinviewcontainer.h"
#include "global.h"
+#include "search/dolphinquery.h"
#include "settings/dolphinsettingsdialog.h"
#include "trash/dolphintrash.h"
#include "views/dolphinview.h"
@@ -74,7 +75,12 @@ void DolphinContextMenu::addAllActions()
if (scheme == QLatin1String("trash")) {
m_context |= TrashContext;
} else if (scheme.contains(QLatin1String("search"))) {
- m_context |= SearchContext;
+ const auto query = Search::DolphinQuery(m_baseUrl, QUrl());
+ if (query.searchPath().scheme() == QLatin1String("trash")) {
+ m_context |= TrashContext;
+ } else {
+ m_context |= SearchContext;
+ }
} else if (scheme.contains(QLatin1String("timeline"))) {
m_context |= TimelineContext;
} else if (scheme == QStringLiteral("recentlyused")) {