┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNate Graham <[email protected]>2019-04-08 16:03:48 -0600
committerNate Graham <[email protected]>2019-04-09 20:19:17 -0600
commit14f0cd52f61de7539e2d9c751966594708ed0281 (patch)
tree52cb7a6b23c852c22e37221a41850c497acfd9ae /src
parentdbc5e57192b48da80846044c6432b1397dbcc154 (diff)
Don't show "Open With" menu items for empty directories
Summary: Any app that registers itself as able to open directories generally can't do anything useful with an empty directory. So, don't show the {nav Open With} menu items for them. Test Plan: Before: {F6759793} After: {F6759794} The {nav Open With} items still appear for non-empty directories. Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: trmdi, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D20396
Diffstat (limited to 'src')
-rw-r--r--src/dolphincontextmenu.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index 439de930a..d32d35dd3 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -351,7 +351,12 @@ void DolphinContextMenu::openViewportContextMenu()
KFileItemActions fileItemActions;
fileItemActions.setParentWidget(m_mainWindow);
fileItemActions.setItemListProperties(baseUrlProperties);
- addOpenWithActions(fileItemActions);
+
+ // Don't show "Open With" menu items if the current dir is empty, because there's
+ // generally no app that can do anything interesting with an empty directory
+ if (view->itemsCount() != 0) {
+ addOpenWithActions(fileItemActions);
+ }
// Insert 'New Window' and 'New Tab' entries. Don't use "open_in_new_window" and
// "open_in_new_tab" here, as the current selection should get ignored.