diff options
Diffstat (limited to 'desktop-widgets/command_base.cpp')
-rw-r--r-- | desktop-widgets/command_base.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/desktop-widgets/command_base.cpp b/desktop-widgets/command_base.cpp index 24ce81225..26a587f7c 100644 --- a/desktop-widgets/command_base.cpp +++ b/desktop-widgets/command_base.cpp @@ -1,17 +1,33 @@ // SPDX-License-Identifier: GPL-2.0 #include "command_base.h" +#include "core/qthelper.h" // for updateWindowTitle() 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")); |