mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 09:45:35 +00:00
move code for storing old value from ModifyCommand constructor to redo function (allows use of the command on records that haven't been created at the time of construction)
This commit is contained in:
parent
70275350de
commit
33243c8c16
1 changed files with 1 additions and 2 deletions
|
@ -10,13 +10,12 @@ CSMWorld::ModifyCommand::ModifyCommand (QAbstractItemModel& model, const QModelI
|
|||
const QVariant& new_, QUndoCommand* parent)
|
||||
: QUndoCommand (parent), mModel (model), mIndex (index), mNew (new_)
|
||||
{
|
||||
mOld = mModel.data (mIndex, Qt::EditRole);
|
||||
|
||||
setText ("Modify " + mModel.headerData (mIndex.column(), Qt::Horizontal, Qt::DisplayRole).toString());
|
||||
}
|
||||
|
||||
void CSMWorld::ModifyCommand::redo()
|
||||
{
|
||||
mOld = mModel.data (mIndex, Qt::EditRole);
|
||||
mModel.setData (mIndex, mNew);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue