[Icon Applet] Add "Open With" and "Open Containing Folder" actions
ClosedPublic

Authored by broulik on Jan 1 2017, 3:41 PM.

Details

Summary

This adds the "Open With..." option known from Dolphin to the icon applet when it points to a file. Also adds a "Open Containing Folder".
While at it, moves the action logic for jump list actions to C++ side

Test Plan
  • Jump list actions still work
  • Open with works, both the primary entry, submenu, and "Open with" dialog
  • "open containing folder" opens the parent folder and scrolls to the file

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik updated this revision to Diff 9580.Jan 1 2017, 3:41 PM
broulik retitled this revision from to [Icon Applet] Add "Open With" and "Open Containing Folder" actions.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added reviewers: Plasma, Plasma: Design.
broulik set the repository for this revision to R120 Plasma Workspace.
Restricted Application added a project: Plasma. · View Herald TranscriptJan 1 2017, 3:41 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart added a subscriber: mart.Jan 2 2017, 10:18 AM

if i understood correctly the code, for deskto files that points to an app shortcut those two entries would not be added, right? (that's i think how it should work)

anthonyfieroni added inline comments.
applets/icon/iconapplet.cpp
235

Make it smart pointer or assign nullptr after deletion or you hit a crash below

broulik updated this revision to Diff 9637.Jan 3 2017, 9:04 AM
  • assign nullptr after delete

for deskto files that points to an app shortcut those two entries would not be added, right?

Yes, "Open With" for apps doesn't make sense (what, open desktop file in editor?) and "Open containing folder" would open /usr/share/applications, very useful ;)

broulik updated this revision to Diff 9638.Jan 3 2017, 9:06 AM
  • Parent jump list QAction to the applet not to leak them
broulik updated this revision to Diff 9647.Jan 3 2017, 11:37 AM
  • Only offer Open With when for protocols that support listing (avoids it trying to open the "parent folder" of a website url)
mart accepted this revision.Jan 3 2017, 12:59 PM
mart added a reviewer: mart.
This revision is now accepted and ready to land.Jan 3 2017, 12:59 PM
This revision was automatically updated to reflect the committed changes.