From 9bf03a3c48f4847b5e0417e3529bf071108cbf1e Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 21 Oct 2014 20:44:37 +0200 Subject: Dolphin: port to KIO::pasteInfoText(). DolphinContextMenu::createPasteAction used to be precise about destination ("Paste To Folder"), while now it's precise about the source (what to paste). It was decided that this was more useful and consistent anyway. REVIEW: 120695 --- src/panels/folders/treeviewcontextmenu.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/panels/folders/treeviewcontextmenu.cpp') diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp index 4afe9e8e3..85d1215c6 100644 --- a/src/panels/folders/treeviewcontextmenu.cpp +++ b/src/panels/folders/treeviewcontextmenu.cpp @@ -70,10 +70,12 @@ void TreeViewContextMenu::open() QAction* copyAction = new QAction(QIcon::fromTheme("edit-copy"), i18nc("@action:inmenu", "Copy"), this); connect(copyAction, &QAction::triggered, this, &TreeViewContextMenu::copy); - const QPair pasteInfo = KonqOperations::pasteInfo(m_fileItem.url()); - QAction* pasteAction = new QAction(QIcon::fromTheme("edit-paste"), pasteInfo.second, this); + const QMimeData *mimeData = QApplication::clipboard()->mimeData(); + bool canPaste; + const QString text = KIO::pasteActionText(mimeData, &canPaste, m_fileItem); + QAction* pasteAction = new QAction(QIcon::fromTheme("edit-paste"), text, this); connect(pasteAction, &QAction::triggered, this, &TreeViewContextMenu::paste); - pasteAction->setEnabled(pasteInfo.first); + pasteAction->setEnabled(canPaste); popup->addAction(cutAction); popup->addAction(copyAction); -- cgit v1.3