Adding measures does not mark the file as changed
GIT commit: 86e51ad
When you add new tabs (Alt Shift+B), the filename does not get an asterisk to mark it as changed. See attached picture before.gif and after.gif
Attachment | Size |
---|---|
after.gif | 13.04 KB |
before.gif | 9.91 KB |
Comments
The "*" doesn't show right away but the flag is being updated. If I do this operation and click on some whitespace in the score the "*" will appear.
I think this might be a duplicate?
#10097: Indicator of impending save does not appear immediately for new scores
It may have the same underlying cause, but seem different in that it happens on generating parts.
Apparently what marks a score "dirty" is the presence of actions on the undo stack since last save. So any action that is undoable should mark the score dirty; any action that is not won't. Not sure this is ideal, but in any case, I checked, and sure enough, there seems to be an issue with the commands to insert or append multiple measures. The first time you run either command after score creation, the score is not marked dirty, and the operation is not undoable. Then, if you do it again, the score is marked dirty, and it is undoable. What's weird is, the first operation then becomes undoable as well. That is:
1) new score
2) Alt+Shift+B, choose any number of measures
Result: measures are added, but score is not marked dirty
3) Undo
Result: nothing happens - the measures are not deleted
But then:
4) Alt+Shift+B, choose any number of measures
Result: measures are added, but this time, score *is* marked dirty
And then:
5) Undo
6) Undo
Result: both operations are successful; you are returned to your original score, no longer marked dirty.
So somehow the undo stack is being set up improperly on the insertion of multiple measures.
Cause is missing mscore->endCmd(). I can add one at the end of ScoreView::cmdAppendMeasures() and ScoreView::cmdInsertMeasures(), but that will result in it being called twice when adding just a single measure via Ctrl+B or Ins. If that's OK, then the fix is that easy. Otherwise, a little refactoring might be in order.
Fixed in 24419cbf95
Calling mscore->endCmd() twice should not hurt. Every call to score->endCmd() should update the UI and call mscore->endCmd(). To ensure this mscore->endCmd() is now called at the end of score->endCmd().
Automatically closed -- issue fixed for 2 weeks with no activity.