X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/68bb0ec22af0290d298a87a15006f888b0aaf3b9..e076d8668f673e09ddd01b3367e413a494d6d2bb:/src/dolphinremoveaction.h diff --git a/src/dolphinremoveaction.h b/src/dolphinremoveaction.h index fd8fc35d6..9ea3406e8 100644 --- a/src/dolphinremoveaction.h +++ b/src/dolphinremoveaction.h @@ -1,5 +1,6 @@ /*************************************************************************** - * Copyright (C) 2013 by Dawit Alemayehu * + * Copyright (C) 2017 by Elvis Angelaccio * * * * 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 * @@ -22,27 +23,36 @@ #include "dolphin_export.h" +#include + #include #include -#include - /** * A QAction that manages the delete based on the current state of * the Shift key or the parameter passed to update. * - * This class expects the presence of both the "move_to_trash" and + * This class expects the presence of both the KStandardAction::MoveToTrash and * KStandardAction::DeleteFile actions in @ref collection. */ 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();