Ignore unknown xml tags in musescore *.mscz/*.mscx files

• Feb 10, 2015 - 13:32
Type
Functional
Severity
S4 - Minor
Status
closed
Project

instead of crashing, musescore should ignore unknown xml tags in input files.
This gives some form of upward/downward compatibility between musescore versions.


Comments

However that change doesn't compile, at least not on Mac:

/Users/build/build-bot/musescore_nightly/libmscore/xml.cpp:181:7: error: member function 'skipCurrentElement' not viable: 'this' argument has type 'const Ms::XmlReader', but function is not marked const
skipCurrentElement();
^~~~~~~~~~~~~~~~~~
/Users/build/build-bot/musescore_nightly/thirdparty/xmlstream/xmlstream.h:263:10: note: 'skipCurrentElement' declared here
void skipCurrentElement();
^

Travis (and therefor Linux) isn't happy with it either:
/home/travis/build/musescore/MuseScore/libmscore/xml.cpp: In member function ‘void Ms::XmlReader::unknown() const’:

/home/travis/build/musescore/MuseScore/libmscore/xml.cpp:181:26: error: passing ‘const Ms::XmlReader’ as ‘this’ argument of ‘void XmlStreamReader::skipCurrentElement()’ discards qualifiers [-fpermissive]

skipCurrentElement();

For now the answer is no, as the typical user does not see a console window. However it would be very annoying to get a warning for every XML tag ignored. A generic message that "some" tags were ignored is useless without knowing which ones. And an aggregate message showing all ignored tags would be complex and overwhelming. What to do...

ugh, it looked so simple!

If you open a score file which is created with a newer version of musescore you get a warning.
Unknown xml tags are then silently ignored.

the devil 's in the details ;-)
Not so silent, there is a qDebug() message, or am I missing something?
No Alertbox or anything in the GUI though.

qDebug is silent as far as most of the world will be concerned - they only show up when starting MuseScore from a console window. And we generate those many places for other less interesting reasons anyhow.