Commit 542e9a24 authored by Nate Graham's avatar Nate Graham
Browse files

foldermodel: hide paste action when right-clicking on files

It doesn't make sense to offer a paste action when right-clicking on a
file as it implies that the paste will overwrite the file, or at least
interact with it in some way, but this is false.

Dolphin follows this logic and doesn't offer a paste action when
right-clicking on files, but Folder View does not, and it should.
This commit makes the Paste action not appear if the thing that was
right-clicked on is a file, rather than a folder or the wallpaper.

BUG: 448913
FIXED-IN: 5.24


(cherry picked from commit 7d0c7ff8)
parent 4ca5fcb4
Pipeline #138134 passed with stage
in 3 minutes and 43 seconds
......@@ -1847,8 +1847,10 @@ void FolderModel::openContextMenu(QQuickItem *visualParent, Qt::KeyboardModifier
menu->addSeparator();
menu->addAction(m_actionCollection.action(QStringLiteral("cut")));
menu->addAction(m_actionCollection.action(QStringLiteral("copy")));
if (urls.length() == 1 && items.first().isDir()) {
menu->addAction(m_actionCollection.action(QStringLiteral("pasteto")));
if (urls.length() == 1) {
if (items.first().isDir()) {
menu->addAction(m_actionCollection.action(QStringLiteral("pasteto")));
}
} else {
menu->addAction(m_actionCollection.action(QStringLiteral("paste")));
}
......
Supports Markdown
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