┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2016-09-21 18:13:29 +0200
committerElvis Angelaccio <[email protected]>2016-09-21 18:13:29 +0200
commit3775ef19eaca057985b92cfa3716d3c3a1d22f0f (patch)
treec57c3530fe4e9454b827f7340019ebbe511fffa8 /src
parente93e6d4cc5231c5ee209f1ac9df70bbb253ce786 (diff)
Properly check Shift toggling in DolphinRemoveAction
Documentation of QGuiApplication::keyboardModifiers() says that "It should be noted this may not reflect the actual keys held on the input device at the time of calling but rather the modifiers as last reported in one of the above events". Since this method is called in DolphinContextMenu's keyPressEvent() and keyReleaseEvent(), the first time that keyboardModifiers() is called it doesn't report that shift has been pressed. Replacing this method with queryKeyboardModifiers() does the job because the latter doesn't care about the event queue. BUG: 354301 FIXED-IN: 16.08.2 REVIEW: 128972
Diffstat (limited to 'src')
-rw-r--r--src/dolphinremoveaction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dolphinremoveaction.cpp b/src/dolphinremoveaction.cpp
index c91d74579..10ab25112 100644
--- a/src/dolphinremoveaction.cpp
+++ b/src/dolphinremoveaction.cpp
@@ -45,7 +45,7 @@ void DolphinRemoveAction::update()
// Using setText(action->text()) does not apply the &-shortcut.
// This is only done until the original action has been shown at least once. To
// bypass this issue, the text and &-shortcut is applied manually.
- if (qApp->keyboardModifiers() & Qt::ShiftModifier) {
+ if (qApp->queryKeyboardModifiers() & Qt::ShiftModifier) {
m_action = m_collection ? m_collection->action(QStringLiteral("delete")) : 0;
setText(i18nc("@action:inmenu", "&Delete"));
} else {