┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMéven Car <[email protected]>2020-11-30 09:01:27 +0100
committerMéven Car <[email protected]>2020-11-30 22:18:48 +0100
commitc2a7bde383e4ffab6f4397bcfc7d3896adab877f (patch)
treeffb593f1a0839c64d689801dc0832b98530d8a22 /src
parent81c9422df5de1fdb61459684c3246af8c8e642ed (diff)
Re-allow to paste files via context menu
BUG: 429762
Diffstat (limited to 'src')
-rw-r--r--src/dolphincontextmenu.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index dcf4b9b45..283f52565 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -433,23 +433,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));
}
}
}