From 01761798a93bc93f3e16f8fb68fe5739ab66d98b Mon Sep 17 00:00:00 2001 From: Dawit Alemayehu Date: Sat, 9 Feb 2013 15:56:51 -0500 Subject: - Factored out the Delete/Move To Trash action into own class. - Updated both the Dolphin KPart and context menu to use the new DolphinRemoveAction class to manage "Delete/Move to Trash" actions. See also https://git.reviewboard.kde.org/r/107509/. REVIEW: 108802 --- src/dolphinremoveaction.h | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/dolphinremoveaction.h (limited to 'src/dolphinremoveaction.h') diff --git a/src/dolphinremoveaction.h b/src/dolphinremoveaction.h new file mode 100644 index 000000000..1a123ace5 --- /dev/null +++ b/src/dolphinremoveaction.h @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (C) 2013 by Dawit Alemayehu +#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. + */ +class LIBDOLPHINPRIVATE_EXPORT DolphinRemoveAction : public QAction +{ + Q_OBJECT +public: + DolphinRemoveAction(QObject* parent, KActionCollection* collection); + /** + * Updates this action key based on the state of the Shift key. + */ + void update(); + +private Q_SLOTS: + void slotRemoveActionTriggered(); + +private: + QPointer m_collection; + QPointer m_action; +}; + +#endif -- cgit v1.3