// TODO replace with KonqOperations::doDrop [or move doDrop code into this class]
// Note that this means changing the DolphinDropController controller usage
// to "create with new and let it autodelete" instead of on stack, since doDrop is async.
+// NOTE: let's wait for KDirModel::dropEvent first.
DolphinDropController::DolphinDropController(QWidget* parentWidget)
: QObject(parentWidget), m_parentWidget(parentWidget)
kDebug() << "Source" << urls;
kDebug() << "Destination:" << destination;
+ if (destination.protocol() == "trash") {
+ KonqOperations::del(m_parentWidget, KonqOperations::TRASH, urls);
+ return;
+ }
+
Qt::DropAction action = Qt::CopyAction;
Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
const bool shiftPressed = modifier & Qt::ShiftModifier;
const bool controlPressed = modifier & Qt::ControlModifier;
- if (shiftPressed && controlPressed) {
- // shortcut for 'Link Here' is used
+ const bool altPressed = modifier & Qt::AltModifier;
+ if ((shiftPressed && controlPressed) || altPressed) {
action = Qt::LinkAction;
- } else if (shiftPressed) {
- // shortcut for 'Move Here' is used
- action = Qt::MoveAction;
} else if (controlPressed) {
- // shortcut for 'Copy Here' is used
action = Qt::CopyAction;
+ } else if (shiftPressed) {
+ action = Qt::MoveAction;
} else {
// open a context menu which offers the following actions:
// - Move Here
seq = QKeySequence(Qt::ControlModifier + Qt::ShiftModifier).toString();
seq.chop(1);
- QAction* linkAction = popup.addAction(KIcon("insert-link"),
+ QAction* linkAction = popup.addAction(KIcon("edit-link"),
i18nc("@action:inmenu",
"&Link Here\t<shortcut>%1</shortcut>", seq));
switch (action) {
case Qt::MoveAction:
KonqOperations::copy(m_parentWidget, KonqOperations::MOVE, urls, destination);
- emit doingOperation(KonqFileUndoManager::MOVE);
+ emit doingOperation(KIO::FileUndoManager::Move);
break;
case Qt::CopyAction:
KonqOperations::copy(m_parentWidget, KonqOperations::COPY, urls, destination);
- emit doingOperation(KonqFileUndoManager::COPY);
+ emit doingOperation(KIO::FileUndoManager::Copy);
break;
case Qt::LinkAction:
KonqOperations::copy(m_parentWidget, KonqOperations::LINK, urls, destination);
- emit doingOperation(KonqFileUndoManager::LINK);
+ emit doingOperation(KIO::FileUndoManager::Link);
break;
default: