-
Notifications
You must be signed in to change notification settings - Fork 2
Undo redo manager batch 1 #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undo redo manager batch 1 #15
Conversation
Also fixes potential issue where mSelectionRect would be expanded, even if YesOrNo is false.
This is done automatically in the QObject destructor. Calling it here could potentially mess up code it we ever use the destroyed() signal for this object.
Mostly this was just refactoring to remove the redundant code between functions, but it also makes minor functional changes which will hopefully not affect anything: - Empty sound frames are now overridden - The current layer is not changed if adding the new keyframe was unsuccessful - currentLayerChanged(), frameModified(), and animationLengthChanged() will now be emitted
More refactoring, with the following functional changes: - deselectAll is called before removing frame with removeKeyAtLayerId - currentLayerChanged(), frameModified(), and animationLengthChanged() is emitted even if the layer isn't changed with removeKeyAtId - Case where no layer with id layerId is caught
| if (shouldBackup) | ||
| { | ||
| backup(tr("Remove frame")); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would you want to remove a key and not do a state change? we won't be able to go back otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removeKeyAtLayerId wasn't backing it up before these changes. You want to remove a key and not do a state change when you're calling that from backupelements so you don't get into some infinite backup loop. Key removals triggered by an action use removeKey() which still does a back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agh.. you're right, I forgot about that one. I couldn't remember it well enough and the diff didn't make it obvious.
MrStevns
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one comment but otherwise the changes looks good.
👍
I will merge.
These are the suggested changes I have so far for the undo-redo-manager branch. This should just about cover all the issues I've found outside of backupmanager.h/.cpp and backupelement.h/.cpp. Review of those files is ongoing and will require some back-and-forth.