LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
8.18k stars 1.01k forks source link

Change how PatternTrack clones are named #7550

Closed regulus79 closed 4 weeks ago

regulus79 commented 1 month ago

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 commented 4 weeks ago

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