From 0aff188d8d0b230e725665bf37dc87d70a0f9398 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sat, 18 Apr 2015 07:13:02 +1000 Subject: [PATCH] Fix enum delegate from adding a command to the undo stack when the value has not changed. --- apps/opencs/view/world/enumdelegate.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/opencs/view/world/enumdelegate.cpp b/apps/opencs/view/world/enumdelegate.cpp index 7c305b1b6..eb523f781 100644 --- a/apps/opencs/view/world/enumdelegate.cpp +++ b/apps/opencs/view/world/enumdelegate.cpp @@ -21,7 +21,9 @@ void CSVWorld::EnumDelegate::setModelDataImp (QWidget *editor, QAbstractItemMode iter!=mValues.end(); ++iter) if (iter->second==value) { - addCommands (model, index, iter->first); + // do nothing if the value has not changed + if (model->data(index).toInt() != iter->first) + addCommands (model, index, iter->first); break; } }