┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphincontextmenu.cpp
diff options
context:
space:
mode:
authorNate Graham <[email protected]>2020-11-30 17:08:46 -0700
committerNate Graham <[email protected]>2020-11-30 17:08:46 -0700
commitce11325115b8655fd687c78fdf0b1c358806195e (patch)
treee8bea60fdb7db4d7b3a28cc829d54451b901504a /src/dolphincontextmenu.cpp
parentdbf0f645d26565e8c666f973de02cc31da0470ec (diff)
parentc2a7bde383e4ffab6f4397bcfc7d3896adab877f (diff)
Merge branch 'release/20.12'
Diffstat (limited to 'src/dolphincontextmenu.cpp')
-rw-r--r--src/dolphincontextmenu.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index 9c96130f2..925951bbf 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -432,23 +432,23 @@ QAction* DolphinContextMenu::createPasteAction()
{
QAction* action = nullptr;
KFileItem destItem;
- if (!m_fileInfo.isNull()) {
+ if (!m_fileInfo.isNull() && m_selectedItems.count() <= 1) {
destItem = m_fileInfo;
} else {
destItem = baseFileItem();
}
if (!destItem.isNull() && destItem.isDir()) {
- if (m_selectedItems.count() <= 1) {
- const QMimeData *mimeData = QApplication::clipboard()->mimeData();
- bool canPaste;
- const QString text = KIO::pasteActionText(mimeData, &canPaste, destItem);
- action = new QAction(QIcon::fromTheme(QStringLiteral("edit-paste")), text, this);
- if (canPaste) {
+ const QMimeData *mimeData = QApplication::clipboard()->mimeData();
+ bool canPaste;
+ const QString text = KIO::pasteActionText(mimeData, &canPaste, destItem);
+ if (canPaste) {
+ if (destItem == m_fileInfo) {
+ // if paste destination is a selected folder
+ action = new QAction(QIcon::fromTheme(QStringLiteral("edit-paste")), text, this);
connect(action, &QAction::triggered, m_mainWindow, &DolphinMainWindow::pasteIntoFolder);
} else {
- // don't add the unavailable action
- action = nullptr;
+ action = m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::Paste));
}
}
}