summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command_base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/command_base.cpp')
-rw-r--r--desktop-widgets/command_base.cpp56
1 files changed, 0 insertions, 56 deletions
diff --git a/desktop-widgets/command_base.cpp b/desktop-widgets/command_base.cpp
deleted file mode 100644
index bef9da09c..000000000
--- a/desktop-widgets/command_base.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-
-#include "command_base.h"
-#include "core/qthelper.h" // for updateWindowTitle()
-#include "core/subsurface-qt/DiveListNotifier.h"
-
-namespace Command {
-
-static QUndoStack undoStack;
-
-// General commands
-void init()
-{
- QObject::connect(&undoStack, &QUndoStack::cleanChanged, &updateWindowTitle);
-}
-
-void clear()
-{
- undoStack.clear();
-}
-
-void setClean()
-{
- undoStack.setClean();
-}
-
-bool isClean()
-{
- return undoStack.isClean();
-}
-
-QAction *undoAction(QObject *parent)
-{
- return undoStack.createUndoAction(parent, QCoreApplication::translate("Command", "&Undo"));
-}
-
-QAction *redoAction(QObject *parent)
-{
- return undoStack.createRedoAction(parent, QCoreApplication::translate("Command", "&Redo"));
-}
-
-bool execute(Base *cmd)
-{
- if (cmd->workToBeDone()) {
- undoStack.push(cmd);
- emit diveListNotifier.commandExecuted();
- return true;
- } else {
- delete cmd;
- return false;
- }
-}
-
-} // namespace Command
-
-