这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@scribblemaniac
Copy link

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.

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
Comment on lines +1088 to +1091
if (shouldBackup)
{
backup(tr("Remove frame"));
}
Copy link
Owner

@MrStevns MrStevns Jul 7, 2021

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.

Copy link
Author

@scribblemaniac scribblemaniac Jul 7, 2021

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.

Copy link
Owner

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.

Copy link
Owner

@MrStevns MrStevns left a 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.

@MrStevns MrStevns merged commit 7323aea into MrStevns:undo-redo-manager Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants