Skip to content
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

Allow node name reuse after delete #733

Merged
merged 2 commits into from Dec 24, 2021
Merged

Allow node name reuse after delete #733

merged 2 commits into from Dec 24, 2021

Conversation

devernay
Copy link
Member

This PR is against RB-2.4, but will be merged in RB-2.5 ultimately.

fixes #732 (this bug has been here forever)

Explanation: the nodes are not deleted while they're still in the Undo stack (which has a depth of 20 actions by default). You'll notice that if you do 20 actions (move 20 times a node in the graph), you will be able to do that rename.

I have a proposed change, which allows using the name of an existing deactivated node. To reactivate the deactivated node, the name change would be reverted by RenameNodeUndoRedoCommand::undo() anyway.

I had to add a few checks in the code:
I had to make sure that every use of Node::getScriptName_mt_safe() (except for printing messages) was also checking if the node was activated.

This seems to work.

@rodlie @YakoYakoYokuYoku Please decline the review if you think you can't review

Copy link
Contributor

@rodlie rodlie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works for me. I have not noticed any undo issues related to this change.

Copy link
Member

@YakoYakoYokuYoku YakoYakoYokuYoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will test for RB-2.5 too.

@devernay devernay merged commit ec9b55a into RB-2.4 Dec 24, 2021
devernay added a commit that referenced this pull request Dec 25, 2021
* Allow node name reuse after delete

fixes #732

* when creating/pasting nodes, don't add more underscores than necessary.

addresses #732 (comment)
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.

None yet

3 participants