┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphincontextmenu.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-03-29 14:54:56 +0000
committerPeter Penz <[email protected]>2008-03-29 14:54:56 +0000
commitc33b01efb2aed904af9ffaef27fb3b0b4bdda37b (patch)
tree8de624beb23caaf5296e4bf3428d8e92174fc689 /src/dolphincontextmenu.cpp
parent6816615900b3175ceccaa1b85f318d4a8f5f1230 (diff)
Move the pasteIntoFolder() method from the contextmenu into DolphinView. This allows to show the information inside the statusbar, that the paste operation has been completed (also some code duplication can be prevented by the way).
svn path=/trunk/KDE/kdebase/apps/; revision=791436
Diffstat (limited to 'src/dolphincontextmenu.cpp')
-rw-r--r--src/dolphincontextmenu.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index e17987fdd..dd88fb74b 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -95,25 +95,6 @@ void DolphinContextMenu::open()
}
}
-void DolphinContextMenu::pasteIntoFolder()
-{
- // TODO: this method should go into DolphinView (see DolphinContextMenu::createPasteAction())
- Q_ASSERT(m_selectedItems.count() == 1);
- Q_ASSERT(m_fileInfo.isDir());
-
- QClipboard* clipboard = QApplication::clipboard();
- const QMimeData* mimeData = clipboard->mimeData();
-
- const KUrl::List source = KUrl::List::fromMimeData(mimeData);
- const KUrl& dest = m_fileInfo.url();
- if (KonqMimeData::decodeIsCutSelection(mimeData)) {
- KonqOperations::copy(m_mainWindow, KonqOperations::MOVE, source, dest);
- clipboard->clear();
- } else {
- KonqOperations::copy(m_mainWindow, KonqOperations::COPY, source, dest);
- }
-}
-
void DolphinContextMenu::openTrashContextMenu()
{
Q_ASSERT(m_context & TrashContext);
@@ -435,14 +416,13 @@ QString DolphinContextMenu::placesName(const KUrl& url) const
QAction* DolphinContextMenu::createPasteAction()
{
- // TODO: move this method as QAction* action pasteAction() into DolphinMainWindow
QAction* action = 0;
if ((m_selectedItems.count() == 1) && m_fileInfo.isDir()) {
action = new QAction(KIcon("edit-paste"), i18nc("@action:inmenu", "Paste Into Folder"), this);
const QMimeData* mimeData = QApplication::clipboard()->mimeData();
const KUrl::List pasteData = KUrl::List::fromMimeData(mimeData);
action->setEnabled(!pasteData.isEmpty());
- connect(action, SIGNAL(triggered()), this, SLOT(pasteIntoFolder()));
+ connect(action, SIGNAL(triggered()), m_mainWindow, SLOT(pasteIntoFolder()));
} else {
action = m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::Paste));
}