X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/01761798a93bc93f3e16f8fb68fe5739ab66d98b..a1c9bc5595a21299dab9260c6a77c0561c95c8ba:/src/dolphinremoveaction.h diff --git a/src/dolphinremoveaction.h b/src/dolphinremoveaction.h index 1a123ace5..645359da0 100644 --- a/src/dolphinremoveaction.h +++ b/src/dolphinremoveaction.h @@ -1,48 +1,40 @@ -/*************************************************************************** - * Copyright (C) 2013 by Dawit Alemayehu + * SPDX-FileCopyrightText: 2017 Elvis Angelaccio + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #ifndef DOLPHINREMOVEACTION_H #define DOLPHINREMOVEACTION_H -#include "libdolphin_export.h" +#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 "delete" - * actions in @ref collection. + * This class expects the presence of both the KStandardAction::MoveToTrash and + * KStandardAction::DeleteFile actions in @ref collection. */ -class LIBDOLPHINPRIVATE_EXPORT DolphinRemoveAction : public QAction +class DOLPHIN_EXPORT DolphinRemoveAction : public QAction { - Q_OBJECT + Q_OBJECT public: - DolphinRemoveAction(QObject* parent, KActionCollection* collection); + 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();