-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix 'Set Linear' not saving properly (#1642) #2742
Conversation
@serdnab could you please rename the PR to something more descriptive like " Fix 'Set Linear' not saving properly" It'd be also very good if you renamed your commit too ( |
Did a quick test, seems to fix #1642 for me. I'm not comfortable with merging this though, without any more extensive testing, because I'm not familiar with this part of the codebase at all. |
@LMMS/developers could someone else review/test this PR out, so we could merge? |
Should not the backward compatibility code be in an upgrade method in |
Which is your opinion on opening old projects that their origin versions of lmms didn't have logarithmic knobs. Open it linear or as detected by |
Linear. |
Also as @jasp00 points out, we want to always preserve the bug for older projects when possible. e.g. if it was incorrectly setting Logarithmic before when Linear was explicitly being clicked, write |
@serdnab: This branch has conflicts that must be resolved |
solved |
void upgrade_1_1_0(); | ||
void upgrade_1_1_91(); | ||
|
||
void upgrade(); | ||
|
||
void loadData( const QByteArray & _data, const QString & _sourceFile ); | ||
|
||
void findIds(const QDomElement& elem, QList<jo_id_t>& idList); |
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.
This function does not depend on the class. It should be a static function in DataFile.cpp
.
addressed your requests |
|
||
jo_id_t id; | ||
for(jo_id_t tid = last_assigned_id + 1; | ||
idList.contains(id = tid); tid++) |
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.
id
should be used directly in the loop, tid
is not needed.
done |
void DataFile::upgrade_1_0_99() | ||
{ | ||
jo_id_t last_assigned_id = 0; | ||
|
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.
Empty lines should not have any indentation, but coding conventions are not against this.
Current projects do not need a manual upgrade in this case. |
I added
setScaleType( Linear )
when the loading element doesn't have a child element (containing scale type or automation data) as this is the default save way for non automated linear knobsfixes #1642