Commit 75904877 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Folder View] Disable the actions themselves rather than just not adding them to the menu

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.

Differential Revision: https://phabricator.kde.org/D15162
parent 74697d0c
......@@ -63,9 +63,13 @@ FocusScope {
property var dialog: null
property Item editor: null
function rename()
{
function rename() {
if (gridView.currentIndex != -1) {
var renameAction = folderView.model.action("rename");
if (renameAction && !renameAction.enabled) {
return;
}
if (!editor) {
editor = editorComponent.createObject(listener);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment