mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 16:31:21 +00:00
Don't offer a Move Here/Copy Here/Link Here menu when dropping items above the trash, just move the things into the trash instead. TODO: as the inline comment already says KonqOperations::doDrop() should be used as longterm solution...
svn path=/trunk/KDE/kdebase/apps/; revision=768925
This commit is contained in:
parent
9a944644e9
commit
10f94beaaf
|
@ -45,24 +45,23 @@ void DolphinDropController::dropUrls(const KUrl::List& urls,
|
||||||
kDebug() << "Source" << urls;
|
kDebug() << "Source" << urls;
|
||||||
kDebug() << "Destination:" << destination;
|
kDebug() << "Destination:" << destination;
|
||||||
|
|
||||||
|
if (destination.protocol() == "trash") {
|
||||||
|
KonqOperations::del(m_parentWidget, KonqOperations::TRASH, urls);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Qt::DropAction action = Qt::CopyAction;
|
Qt::DropAction action = Qt::CopyAction;
|
||||||
|
|
||||||
Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
|
Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
|
||||||
const bool shiftPressed = modifier & Qt::ShiftModifier;
|
const bool shiftPressed = modifier & Qt::ShiftModifier;
|
||||||
const bool controlPressed = modifier & Qt::ControlModifier;
|
const bool controlPressed = modifier & Qt::ControlModifier;
|
||||||
const bool altPressed = modifier & Qt::AltModifier;
|
const bool altPressed = modifier & Qt::AltModifier;
|
||||||
if (shiftPressed && controlPressed) {
|
if ((shiftPressed && controlPressed) || altPressed) {
|
||||||
// shortcut for 'Link Here' is used
|
|
||||||
action = Qt::LinkAction;
|
action = Qt::LinkAction;
|
||||||
} else if (shiftPressed) {
|
|
||||||
// shortcut for 'Move Here' is used
|
|
||||||
action = Qt::MoveAction;
|
|
||||||
} else if (controlPressed) {
|
} else if (controlPressed) {
|
||||||
// shortcut for 'Copy Here' is used
|
|
||||||
action = Qt::CopyAction;
|
action = Qt::CopyAction;
|
||||||
} else if (altPressed) {
|
} else if (shiftPressed) {
|
||||||
// shortcut for 'Link Here' is used
|
action = Qt::MoveAction;
|
||||||
action = Qt::LinkAction;
|
|
||||||
} else {
|
} else {
|
||||||
// open a context menu which offers the following actions:
|
// open a context menu which offers the following actions:
|
||||||
// - Move Here
|
// - Move Here
|
||||||
|
|
Loading…
Reference in a new issue