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

Change how PatternTrack clones are named #7550

Closed

Conversation

regulus79
Copy link
Contributor

Description

Instead of naming cloned PatternTracks "Clone of ..." which can quickly build up with "Clone of Clone of Clone of Clone of Clone of ....", this PR changes clones to be named "... 2", and any tracks which have a number at the end to simply increment the number when naming the clone, like "... 3" and "... 4".

How it works

When you clone a track, the current name of the track is split by " ", and the last substring is checked to see if it can be converted to a number. If it can, then the name of the clone is set to the old name plus the number incremented, else it is set to the old name plus "2" at the end.

Notes:

I tried to use .arg() instead of string concatenation for inserting the name and number, but I was unsuccessful. I can try again to see if I can get it working if any of you would like.

Also, I'm guessing we don't need to translate it anymore? I still have tr("%1 2") there, but I can remove the tr it if you want.

@regulus79 regulus79 changed the title Change how clones are named Change how PatternTrack clones are named Oct 19, 2024
@regulus79
Copy link
Contributor Author

Closing because #7557 gives a more general solution for all tracks.

@regulus79 regulus79 closed this Oct 23, 2024
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.

1 participant