<table><tr><td style="">broulik created this revision.<br />broulik added reviewers: Plasma, davidedmundson, hein.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />broulik requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D15162">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Folder View is built on the assumption that actions can only be triggered from the context menu.<br />
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.<br />
This patch changes the context menu to always include all (most of them, anyway) actions but instead have <tt style="background: #ebebeb; font-size: 13px;">updateActions()</tt> disable or hide them as needed.<br />
Also, take into account <tt style="background: #ebebeb; font-size: 13px;">KFileItemListProperties</tt> for more actions (e.g. Cut, Paste, Rename, Trash, …) like Dolphin does it.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>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</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Made my desktop folder read-only (requires <a href="https://phabricator.kde.org/D15161" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D15161</a> to work properly)</li>
<li class="remarkup-list-item">Paste, Cut, Rename options were disabled, Trash option was hidden</li>
<li class="remarkup-list-item">In trash:/ "Delete" and "Empty Trash" showed up fine</li>
<li class="remarkup-list-item">Some options that make no sense for trash (Rename, "Create New") are hidden, like in Dolphin</li>
<li class="remarkup-list-item">F2 still unconditionally allows renaming but that is because QML doesn't check</li>
</ul>
<p>Together with <a href="https://phabricator.kde.org/D15160" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D15160</a> this allows locking down the desktop for the user when you make the desktop folder read-only</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R119 Plasma Desktop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15162">https://phabricator.kde.org/D15162</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>containments/desktop/plugins/folder/foldermodel.cpp</div></div></div><br /><div><strong>To: </strong>broulik, Plasma, davidedmundson, hein<br /><strong>Cc: </strong>plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>