forked from mirror/openmw-tes3mp
Added undo for delete command
This commit is contained in:
parent
d73f4cbd7b
commit
a0146e2e28
1 changed files with 10 additions and 1 deletions
|
@ -209,7 +209,16 @@ void CSMWorld::DeleteNestedCommand::redo()
|
||||||
|
|
||||||
void CSMWorld::DeleteNestedCommand::undo()
|
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)
|
CSMWorld::AddNestedCommand::AddNestedCommand(IdTable& model, const std::string& id, int nestedRow, int parentColumn, QUndoCommand* parent)
|
||||||
|
|
Loading…
Reference in a new issue