|
|
|
@ -25,6 +25,27 @@ void CSMWorld::ModifyCommand::undo()
|
|
|
|
|
mModel.setData (mIndex, mOld);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSMWorld::CloneCommand::CloneCommand (CSMWorld::IdTable& model,
|
|
|
|
|
const std::string& idOrigin,
|
|
|
|
|
const std::string& IdDestination,
|
|
|
|
|
CSMWorld::UniversalId::Type type,
|
|
|
|
|
QUndoCommand* parent) :
|
|
|
|
|
QUndoCommand(parent),
|
|
|
|
|
mModel(model),
|
|
|
|
|
mIdOrigin(idOrigin),
|
|
|
|
|
mIdDestination(IdDestination),
|
|
|
|
|
mType(type)
|
|
|
|
|
{
|
|
|
|
|
setText (("Clone record " + idOrigin + " to the " + IdDestination).c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CSMWorld::CloneCommand::redo()
|
|
|
|
|
{
|
|
|
|
|
mModel.cloneRecord(mIdOrigin, mIdDestination, mType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CSMWorld::CreateCommand::CreateCommand (IdTable& model, const std::string& id, QUndoCommand *parent)
|
|
|
|
|
: QUndoCommand (parent), mModel (model), mId (id), mType (UniversalId::Type_None)
|
|
|
|
|
{
|
|
|
|
|