Added undo for delete command

This commit is contained in:
Marek Kochanowicz 2014-06-24 19:34:02 +02:00
parent d73f4cbd7b
commit a0146e2e28

View file

@ -209,7 +209,16 @@ void CSMWorld::DeleteNestedCommand::redo()
void CSMWorld::DeleteNestedCommand::undo()
{
//TODO
const QModelIndex& parentIndex = mModel.getModelIndex(mId, mParentColumn);
mModel.addNestedRow(parentIndex, mNestedRow);
for (int i = 0; i < mModel.columnCount(parentIndex); ++i)
{
const QModelIndex& current = mModel.index(mNestedRow, i, parentIndex);
mModel.setData(current, mOld[i]);
}
}
CSMWorld::AddNestedCommand::AddNestedCommand(IdTable& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent)