Don't show "Open With" menu items for empty directories
ClosedPublic

Authored by ngraham on Apr 8 2019, 10:07 PM.

Details

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 Open With menu items for them.

Test Plan

Before:

After:

The Open With items still appear for non-empty directories.

Diff Detail

Repository
R318 Dolphin
Branch
dont-show-open-with-items-on-empty-dir (branched from Applications/19.04)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10642
Build 10660: arc lint + arc unit
ngraham created this revision.Apr 8 2019, 10:07 PM
Restricted Application added a project: Dolphin. · View Herald TranscriptApr 8 2019, 10:07 PM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
ngraham requested review of this revision.Apr 8 2019, 10:07 PM
trmdi added a subscriber: trmdi.Apr 8 2019, 10:16 PM

What happens if the user wants to open this directory with another program e.g. Dolphin (root mode), Krusader... ?

What happens if the user wants to open this directory with another program e.g. Dolphin (root mode), Krusader... ?

Then they'll be using one of the file action plugins, e.g. the "Root Actions" plugin. Also, this is not exactly an activity we encourage.

trmdi added a comment.Apr 8 2019, 10:26 PM

What happens if the user wants to open this directory with another program e.g. Dolphin (root mode), Krusader... ?

Then they'll be using one of the file action plugins, e.g. the "Root Actions" plugin. Also, this is not exactly an activity we encourage.

Make sense. :)

elvisangelaccio accepted this revision.Apr 9 2019, 8:55 PM
This revision is now accepted and ready to land.Apr 9 2019, 8:55 PM
This revision was automatically updated to reflect the committed changes.

Any app that registers itself as able to open directories generally can't do anything useful with an empty directory.

If I may offer a counter-example (rather late, I know), one category of applications that an "Open with" on an empty dir is quite useful for are code editors. The way many people start new projects, for example, is by creating a new dir (in Dolphin) and using "Open with" to open it in their editor (like VS Code).

I know this workflow can be re-created with an action (like the one for Konsole), but at least to me, "Open with" seems more intuitive for this.

Any app that registers itself as able to open directories generally can't do anything useful with an empty directory.

If I may offer a counter-example (rather late, I know), one category of applications that an "Open with" on an empty dir is quite useful for are code editors. The way many people start new projects, for example, is by creating a new dir (in Dolphin) and using "Open with" to open it in their editor (like VS Code).

I know this workflow can be re-created with an action (like the one for Konsole), but at least to me, "Open with" seems more intuitive for this.

Most code editors I'm aware of don't install MIME type handlers for directories though, so they don't even show up in the Open With menu by default. You would need to set that up yourself. However I can see how once you do, it could be very useful.