Skip to content

Commit

Permalink
fix #152206: Revision is not shown in Score Properties
Browse files Browse the repository at this point in the history
for scores from 2.0 or later, actually for scores created after the move
from sourceforge to GitHub
  • Loading branch information
Jojo-Schmitz committed Jan 15, 2017
1 parent fa56526 commit 6c6010b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions libmscore/read206.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,7 @@ static bool readScore(Score* score, XmlReader& e)

//---------------------------------------------------------
// read206
// import old version > 1.3 and < 2.x files
// import old version > 1.3 and < 3.x files
//---------------------------------------------------------

Score::FileError MasterScore::read206(XmlReader& e)
Expand All @@ -1733,7 +1733,7 @@ Score::FileError MasterScore::read206(XmlReader& e)
parseVersion(mscoreVersion());
}
else if (tag == "programRevision")
setMscoreRevision(e.readInt());
setMscoreRevision(e.readIntHex());
else if (tag == "Score") {
if (!readScore(this, e))
return FileError::FILE_BAD_FORMAT;
Expand Down
2 changes: 1 addition & 1 deletion libmscore/read300.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ Score::FileError MasterScore::read300(XmlReader& e)
parseVersion(mscoreVersion());
}
else if (tag == "programRevision")
setMscoreRevision(e.readInt());
setMscoreRevision(e.readIntHex());
else if (tag == "Score") {
MasterScore* score;
if (top) {
Expand Down
7 changes: 4 additions & 3 deletions libmscore/xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ class XmlReader : public QXmlStreamReader {
bool hasAttribute(const char* s) const;

// helper routines based on readElementText():
int readInt() { return readElementText().toInt(); }
int readInt(bool* ok) { return readElementText().toInt(ok); }
double readDouble() { return readElementText().toDouble(); }
int readInt() { return readElementText().toInt(); }
int readInt(bool* ok) { return readElementText().toInt(ok); }
int readIntHex() { return readElementText().toInt(0, 16); }
double readDouble() { return readElementText().toDouble(); }
double readDouble(double min, double max);
bool readBool();
QPointF readPoint();
Expand Down
7 changes: 6 additions & 1 deletion mscore/metaedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ MetaEditDialog::MetaEditDialog(Score* s, QWidget* parent)

level->setValue(score->mscVersion());
version->setText(score->mscoreVersion());
revision->setValue(score->mscoreRevision());
int rev = score->mscoreRevision();
if (rev > 99999) { // MuseScore 1.3 is 5702, 2.0 uses a 7-digit hex SHA
revision->setDisplayIntegerBase(16);
revision->setMaximum(0xfffffff);
}
revision->setValue(rev);
filePath->setText(score->importedFilePath());

int idx = 0;
Expand Down

0 comments on commit 6c6010b

Please sign in to comment.