┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinremoveaction.h
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2017-08-24 18:33:27 +0200
committerElvis Angelaccio <[email protected]>2017-09-07 21:31:42 +0200
commit2fd85facf85b39f84eeada10bcf80060bb72ab51 (patch)
treef72067d82a5f6f15486cbb6ae4f7aa806c4ff5a2 /src/dolphinremoveaction.h
parent735b171451a05cdda77f711ff1ef23408e9389ed (diff)
Fix DolphinRemoveAction Shift toggling on Wayland
QGuiApplication::queryKeyboardModifiers() does not work on Wayland [1]. We don't need it in the first place, since we already know (thanks to the key events) whether Shift has been pressed or released. So we can just pass this information to DolphinRemoveAction::update(). BUG: 354301 [1]: https://bugreports.qt.io/browse/QTBUG-62786 Differential Revision: https://phabricator.kde.org/D7519
Diffstat (limited to 'src/dolphinremoveaction.h')
-rw-r--r--src/dolphinremoveaction.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/dolphinremoveaction.h b/src/dolphinremoveaction.h
index f9a1b98be..6ba25923a 100644
--- a/src/dolphinremoveaction.h
+++ b/src/dolphinremoveaction.h
@@ -1,5 +1,6 @@
/***************************************************************************
- * Copyright (C) 2013 by Dawit Alemayehu <[email protected] *
+ * Copyright (C) 2013 by Dawit Alemayehu <[email protected]> *
+ * Copyright (C) 2017 by Elvis Angelaccio <[email protected]> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -38,11 +39,20 @@ class DOLPHIN_EXPORT DolphinRemoveAction : public QAction
{
Q_OBJECT
public:
+
+ enum class ShiftState {
+ Unknown,
+ Pressed,
+ Released
+ };
+
DolphinRemoveAction(QObject* parent, KActionCollection* collection);
+
/**
- * Updates this action key based on the state of the Shift key.
+ * Updates this action key based on @p shiftState.
+ * Default value is QueryShiftState, meaning it will query QGuiApplication::modifiers().
*/
- void update();
+ void update(ShiftState shiftState = ShiftState::Unknown);
private Q_SLOTS:
void slotRemoveActionTriggered();