Scores get each other's titles on first edit after reordering tabs, crash on close
2.1 RC
1. Open any two scores at once—say score1 and score2.
2. Drag one of their tabs to change the order.
3. Make any edit to either score.
Result 1: the title displayed in one of the tabs changes to be the same as the other.
Repeating steps 2 and 3 in different combinations, you can get both tabs to say score1, both tabs to say score2, score1's to say score2 and score2's to say score1, and even get them back to their original state.
4. With the tabs not in their original order, close one of the scores.
Result 2: crash.
My hunch is that it's not worth the effort to figure out what's going on, and it's simpler to just revert #8954: Move Tabs Around.
Comments
master, aea3845, has the same issue and crashes too, no useful stack trace though
I'm looking into this now...I don't want to revert the feature.
My hunch is that this is a very simple fix. Looking at https://github.com/musescore/MuseScore/commit/4be4113e5db542360445fb846… I see all that was done is
But I would think that would need to keep track of tab index order somewhere too.
looking at scoretab.h:
So clearly there is a list. But I don't see anywhere where this list order is updated when a tab has been moved.
Oh, and I have a little pet peeve with non-descriptive variable names like "tab" and "tab2"...shouldn't need to have a comment explaining what those tabs are...would be better to just name those variables "tabScores" and "tabExcerpts". Then people will know what those variables refer to just by looking at the names.
So QTabBar has a signal void QTabBar::tabMoved(int from, int to) ...I'm sure this signal should be handled.
When I move a tab around, the slot ScoreTab::setCurrent(int n) gets called with n equal to the new position of the moved tab. But again, I don't see any effort to update scoreList order.
I believe I fixed this issue: https://github.com/musescore/MuseScore/pull/3150
As I mentioned in that PR, I forgot to test if there is a viewSplitter and if there is any particular thing I need to handle in case of split view. I'm away from my machine now to test this... It would be ok if each score tab has its own separate order of scoreList...but I have to look into this.
I pushed an updated PR which handles the fact that each ScoreTab share a pointer to the same score list.
Fixed in branch 2.1, commit df5d867bff
fix #190991 update scoreList order when tabMoved
Also update the tab order for the other ScoreTab.
However since scoreList is a shared pointer between both ScoreTabs, make sure to only update the pointer once.
Fixed in branch 2.1, commit 75539eb9d2
Merge pull request #3150 from ericfont/190991-tabMoved
fix #190991 update scoreList order when tabMoved
Fixed in branch master, commit dd7fbe2657
fix #190991 update scoreList order when tabMoved
Also update the tab order for the other ScoreTab.
However since scoreList is a shared pointer between both ScoreTabs, make sure to only update the pointer once.
Automatically closed -- issue fixed for 2 weeks with no activity.