From 0cfabd6f3b49ed90373975289acf48e15ce83bb5 Mon Sep 17 00:00:00 2001 From: unelsson Date: Sat, 21 Aug 2021 13:42:55 +0300 Subject: [PATCH] Move mapToSource back to constructor --- apps/opencs/model/world/commands.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/opencs/model/world/commands.cpp b/apps/opencs/model/world/commands.cpp index cdb4663390..12c8fa767f 100644 --- a/apps/opencs/model/world/commands.cpp +++ b/apps/opencs/model/world/commands.cpp @@ -189,10 +189,6 @@ void CSMWorld::TouchLandCommand::onUndo() CSMWorld::ModifyCommand::ModifyCommand (QAbstractItemModel& model, const QModelIndex& index, const QVariant& new_, QUndoCommand* parent) : QUndoCommand (parent), mModel (&model), mIndex (index), mNew (new_), mHasRecordState(false), mOldRecordState(CSMWorld::RecordBase::State_BaseOnly) -{ -} - -void CSMWorld::ModifyCommand::redo() { if (QAbstractProxyModel *proxy = dynamic_cast (mModel)) { @@ -200,7 +196,10 @@ void CSMWorld::ModifyCommand::redo() mIndex = proxy->mapToSource (mIndex); mModel = proxy->sourceModel(); } +} +void CSMWorld::ModifyCommand::redo() +{ if (mIndex.parent().isValid()) { CSMWorld::IdTree* tree = &dynamic_cast(*mModel);