Bug 427573

Summary: Context menu in an empty directory does not contain "Open with..."
Product: [Applications] dolphin Reporter: Oto Šťáva <oto.stava>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: elvis.angelaccio, kfm-devel, nate, oto.stava, vibs.35
Priority: NOR    
Version: 20.08.1   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In: 20.12

Description Oto Šťáva 2020-10-12 07:18:13 UTC
SUMMARY
The context menu opened in an empty directory does not have the "Open with..." entry, which could be used e.g. to open an application like VSCode in it.

STEPS TO REPRODUCE
1. Create an empty directory
2. Open it in Dolphin so that the view is blank
3. Right-click the blank Dolphin view

OBSERVED RESULT
There is no "Open with..." entry in the context menu.

EXPECTED RESULT
I would expect an "Open with..." entry to be present so that I can open the empty directory in an application like VSCode to start creating new content in the directory.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro Linux testing
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1

ADDITIONAL INFORMATION
When an empty directory is right-clicked "from the outside", i.e. its icon in the view of its parent directory, the context menu does contain an "Open with..." entry.
Comment 1 Nate Graham 2020-10-12 15:48:50 UTC
This is currently intentional. We got complaints about showing the menu item for empty folders in the past so we changed it in https://invent.kde.org/system/dolphin/-/commit/14f0cd52f61de7539e2d9c751966594708ed0281.

Elvis, what do you think? Should we revert that, or close this as INTENTIONAL?
Comment 2 vibhav kharangate 2020-10-12 20:49:02 UTC
"
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
"

looks like above reasoning mentioned in the commit is proved false according to OP's use case. 

Reverting the commit would be recommended IMO
Comment 3 Elvis Angelaccio 2020-10-12 20:55:17 UTC
Yeah we should probably revert it, since there is a valid use case that is prevented from that commit.
Comment 4 Nate Graham 2020-10-13 00:05:06 UTC
All right, will do.
Comment 5 Nate Graham 2020-10-13 00:18:19 UTC
Git commit b343fdffc52ff42d83afa02f6eaf1f5a359a49a9 by Nate Graham.
Committed on 13/10/2020 at 00:16.
Pushed by ngraham into branch 'master'.

Show "Open With" menu items even for empty dirs

We found some legitimate use cases for this after all! :)

This reverts 14f0cd52f61de7539e2d9c751966594708ed0281
FIXED-IN: 5.12

M  +3    -5    src/dolphincontextmenu.cpp

https://invent.kde.org/system/dolphin/commit/b343fdffc52ff42d83afa02f6eaf1f5a359a49a9