Folder View is built on the assumption that actions can only be triggered from the context menu.
This isn't true as keyboard shortcuts can trigger actions which will only get their correct state just before the menu opens. Moreover, often the action itself isn't disabled/hidden but just not added to the menu, which means it can still be triggered using a keyboard shortcut.
This patch changes the context menu to always include all (most of them, anyway) actions but instead have updateActions() disable or hide them as needed.
Also, take into account KFileItemListProperties for more actions (e.g. Cut, Paste, Rename, Trash, …) like Dolphin does it.
Details
Details
- Reviewers
davidedmundson hein - Group Reviewers
Plasma - Commits
- R119:7590487788e9: [Folder View] Disable the actions themselves rather than just not adding them…
This change is a bit delicate as there's quite a few states to be in: remote files selected, a file inside trash, trash itself, link to trash on the desktop, readonly directory, etc
- Made my desktop folder read-only (requires D15161 to work properly)
- Paste, Cut, Rename options were disabled, Trash option was hidden
- In trash:/ "Delete" and "Empty Trash" showed up fine
- Some options that make no sense for trash (Rename, "Create New") are hidden, like in Dolphin
- Pressing Delete, F2, Ctrl+X, etc do nothing when the actions are disabled
Together with D15160 this allows locking down the desktop for the user when you make the desktop folder read-only
Diff Detail
Diff Detail
- Repository
- R119 Plasma Desktop
- Lint
Lint Skipped - Unit
Unit Tests Skipped