1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 21:49:55 +00:00

do not generate modfiy commands on edits to change a cell to a value equal its original value before the edit

This commit is contained in:
Marc Zinnschlag 2014-04-15 22:34:15 +02:00
parent 30d5040f2f
commit a7cece3d30

View file

@ -108,7 +108,11 @@ void CSVWorld::CommandDelegate::setModelDataImp (QWidget *editor, QAbstractItemM
{
NastyTableModelHack hack (*model);
QStyledItemDelegate::setModelData (editor, &hack, index);
mUndoStack.push (new CSMWorld::ModifyCommand (*model, index, hack.getData()));
QVariant new_ = hack.getData();
if (model->data (index)!=new_)
mUndoStack.push (new CSMWorld::ModifyCommand (*model, index, new_));
}
CSVWorld::CommandDelegate::CommandDelegate (QUndoStack& undoStack, QObject *parent)