History

Add comment to new redo functionality

Ryan Huffman committed 12 years ago

Commit c802c741 parent bdfdeec1 file · +5 −1Browse files

Showing the changes to libraries/script-engine/src/UndoStackScriptingInterface.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/UndoStackScriptingInterface.cpp+5−1
@@ -42,8 +42,12 @@ void ScriptUndoCommand::undo() { · 41 unmodified lines
4242 }
4343
4444 void ScriptUndoCommand::redo() {
45+ // QUndoStack will call `redo()` when adding a command to the stack. This
46+ // makes it difficult to work with commands that span a period of time - for instance,
47+ // the entity duplicate + move command that duplicates an entity and then moves it.
48+ // A better implementation might be to properly implement `mergeWith()` and `id()`
49+ // so that the two actions in the example would be merged.
4550 if (_hasRedone) {
46− qDebug() << "Doing redo!";
4751 QMetaObject::invokeMethod(this, "doRedo");
4852 }
4953 _hasRedone = true;