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 old project migration bugs #17983
Fix old project migration bugs #17983
Conversation
@@ -142,6 +142,7 @@ Ret ProjectMigrator::migrateProject(engraving::EngravingProjectPtr project, cons | |||
return make_ret(Ret::Code::InternalError); | |||
} | |||
|
|||
score->lockUpdates(false); |
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.
We need to make sure that this change won't cause performance issues when opening old scores (because before we called score->update() a lot of times and this caused a big slowdown)
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.
Performance should be unaffected, because I've added an update() call here, but I've also removed an update() call from Read206::readScore(), where it was unnecessary. I've run the profiler, and performance looks the same, with a total of 2 update() calls in both cases.
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.
Can you move this line to NotationProject::doLoad? It's very confusing to see it here
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.
done! 👍
c4bd590
to
f5f13fb
Compare
f5f13fb
to
a923722
Compare
Resolves: #17982
The bug happens because the position of some items (in this case hairpins) is reset when migrating from version 2.x, but we don't call a new layout after that, so the items aren't rendered properly until a relayout happens.
ProjectMigrator::migrateProject
should be responsible for calling this layout. In fact, I think it was designed to do so as it callsscore->endCmd()
, but was being blocked by_updatesLocked
.In turn, there was a pointless layout call being made at the end of
Read206
, which I've removed.