diff options
Diffstat (limited to 'desktop-widgets/command_base.cpp')
-rw-r--r-- | desktop-widgets/command_base.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/desktop-widgets/command_base.cpp b/desktop-widgets/command_base.cpp index 26a587f7c..9316135dd 100644 --- a/desktop-widgets/command_base.cpp +++ b/desktop-widgets/command_base.cpp @@ -38,12 +38,15 @@ QAction *redoAction(QObject *parent) return undoStack.createRedoAction(parent, QCoreApplication::translate("Command", "&Redo")); } -void execute(Base *cmd) +bool execute(Base *cmd) { - if (cmd->workToBeDone()) + if (cmd->workToBeDone()) { undoStack.push(cmd); - else + return true; + } else { delete cmd; + return false; + } } } // namespace Command |