Separate Delete/Move To Trash menu items in context menu

Right now these actions are in a visual group with "Rename" and "Add to
Places" which is silly as those actions have no logical connection
whatsoever to deletion.

This commits moves those items into the section above, putting them in a
more logical place and leaving the Delete/Move To Trash item in its own
section.

BUG: 429256
FIXED-IN: 21.04
This commit is contained in:
Nate Graham 2020-11-17 12:13:30 -07:00
parent b03607b20b
commit b76cc3f6fa

View file

@ -271,15 +271,6 @@ void DolphinContextMenu::openItemContextMenu()
insertDefaultItemActions(selectedItemsProps);
// insert 'Add to Places' entry if appropriate
if (m_selectedItems.count() == 1) {
if (m_fileInfo.isDir()) {
if (!placeExists(m_fileInfo.url())) {
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("add_to_places")));
}
}
}
addSeparator();
fileItemActions.addServiceActionsTo(this);
@ -383,11 +374,20 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties&
}
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("duplicate")));
addSeparator();
// Insert 'Rename'
addAction(collection->action(KStandardAction::name(KStandardAction::RenameFile)));
// insert 'Add to Places' entry if appropriate
if (m_selectedItems.count() == 1) {
if (m_fileInfo.isDir()) {
if (!placeExists(m_fileInfo.url())) {
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("add_to_places")));
}
}
}
addSeparator();
// Insert 'Move to Trash' and/or 'Delete'
const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) ||
!properties.isLocal());