Skip to content

Fix header/footer timestamps update on file save#33579

Merged
ajuncosa merged 6 commits into
musescore:4.7from
ajuncosa:fix-header-footer-timestamps
Jun 4, 2026
Merged

Fix header/footer timestamps update on file save#33579
ajuncosa merged 6 commits into
musescore:4.7from
ajuncosa:fix-header-footer-timestamps

Conversation

@ajuncosa
Copy link
Copy Markdown
Contributor

@ajuncosa ajuncosa commented May 26, 2026

Resolves: #33345

In order to be able to update the timestamps when saving the file, I have added and exposed some functions to layout the headers and footers only, to avoid doing a full re-layout when saving the file. Timestamps are now only updated on save instead of on modifications to the score.

@ajuncosa ajuncosa requested a review from mike-spa May 26, 2026 08:57
@ajuncosa ajuncosa force-pushed the fix-header-footer-timestamps branch from 624b26b to c2299d8 Compare June 1, 2026 09:51
@ajuncosa ajuncosa force-pushed the fix-header-footer-timestamps branch 2 times, most recently from 89805e8 to a57cdcc Compare June 3, 2026 11:00
@ajuncosa ajuncosa force-pushed the fix-header-footer-timestamps branch from 16350cf to 870f4a3 Compare June 3, 2026 16:43
@davidstephengrant
Copy link
Copy Markdown
Contributor

davidstephengrant commented Jun 4, 2026

@ajuncosa Tested and approved on Ubuntu 24.04.4 LTS.

@ajuncosa ajuncosa merged commit 70f1371 into musescore:4.7 Jun 4, 2026
13 checks passed
@ajuncosa ajuncosa deleted the fix-header-footer-timestamps branch June 4, 2026 11:39
if (page->score()->dirty() || !fileInfo->saved()) {
newFragments.back().text += muse::Time::currentTime().toString(muse::DateFormat::ISODate);
if (fileInfo->isNewlyCreated()) {
newFragments.back().text += String(u"HH:mm:ss");
Copy link
Copy Markdown
Contributor

@Jojo-Schmitz Jojo-Schmitz Jun 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's wrong with using the current time here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In these cases, the file has never been saved yet (so it technically does not exist) and we thought it would make more sense to display a placeholder to avoid confusion, since displaying the current time/date could lead to misinterpretation. If we ever support customising the time/date to something other than ISO, we could give this placeholder another think.

Comment thread src/engraving/rendering/score/headerfooterlayout.cpp
@Jojo-Schmitz
Copy link
Copy Markdown
Contributor

Jojo-Schmitz commented Jun 4, 2026

Any chance #15437: The date macros ($d, $D, $M) for header/footer show the dates in ISO format (YYYYY-MM-DD) rather than as per the current locale gets fixed too?
Back in the day switching to using ISO Dates was the easy way out of them using the (bogus/bad) US format and the least effort quick fix

ajuncosa added a commit to ajuncosa/MuseScore that referenced this pull request Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The "last modified" timestamp macros in Header/Footer don't update on File > Save (nor Ctrl+S)

4 participants