Something went wrong. Try again.
OpenMW is an open implementation of the Morrowind engine
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930
#include "commandmacro.hpp"
#include <QUndoCommand>#include <QUndoStack>
CSMWorld::CommandMacro::CommandMacro(QUndoStack& undoStack, const QString& description) : mUndoStack(undoStack) , mDescription(description) , mStarted(false){}
CSMWorld::CommandMacro::~CommandMacro(){ if (mStarted) mUndoStack.endMacro();}
void CSMWorld::CommandMacro::push(QUndoCommand* command){ if (!mStarted) { mUndoStack.beginMacro(mDescription.isEmpty() ? command->text() : mDescription); mStarted = true; }
mUndoStack.push(command);}