mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
implemented cut, copy & paste for sidebar context
svn path=/trunk/KDE/kdebase/apps/; revision=643578
This commit is contained in:
parent
acfccceb91
commit
6bd958c1d7
|
@ -36,6 +36,7 @@
|
||||||
#include <kmessagebox.h>
|
#include <kmessagebox.h>
|
||||||
#include <kmimetypetrader.h>
|
#include <kmimetypetrader.h>
|
||||||
#include <knewmenu.h>
|
#include <knewmenu.h>
|
||||||
|
#include <konqmimedata.h>
|
||||||
#include <konq_operations.h>
|
#include <konq_operations.h>
|
||||||
#include <klocale.h>
|
#include <klocale.h>
|
||||||
#include <kpropertiesdialog.h>
|
#include <kpropertiesdialog.h>
|
||||||
|
@ -43,6 +44,8 @@
|
||||||
#include <kstandardaction.h>
|
#include <kstandardaction.h>
|
||||||
#include <kstandarddirs.h>
|
#include <kstandarddirs.h>
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QClipboard>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
|
DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
|
||||||
|
@ -104,17 +107,36 @@ void DolphinContextMenu::open()
|
||||||
|
|
||||||
void DolphinContextMenu::cut()
|
void DolphinContextMenu::cut()
|
||||||
{
|
{
|
||||||
// TODO
|
QMimeData* mimeData = new QMimeData();
|
||||||
|
KUrl::List kdeUrls;
|
||||||
|
kdeUrls.append(m_fileInfo->url());
|
||||||
|
KonqMimeData::populateMimeData(mimeData, kdeUrls, KUrl::List(), true);
|
||||||
|
QApplication::clipboard()->setMimeData(mimeData);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DolphinContextMenu::copy()
|
void DolphinContextMenu::copy()
|
||||||
{
|
{
|
||||||
// TODO
|
QMimeData* mimeData = new QMimeData();
|
||||||
|
KUrl::List kdeUrls;
|
||||||
|
kdeUrls.append(m_fileInfo->url());
|
||||||
|
KonqMimeData::populateMimeData(mimeData, kdeUrls, KUrl::List(), false);
|
||||||
|
QApplication::clipboard()->setMimeData(mimeData);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DolphinContextMenu::paste()
|
void DolphinContextMenu::paste()
|
||||||
{
|
{
|
||||||
// TODO
|
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::rename()
|
void DolphinContextMenu::rename()
|
||||||
|
|
Loading…
Reference in a new issue