1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
Description: tone down some debug messages
our message handler is a bit loud, hide Score::addElement during
loading of a file and the Score::removeSpanner not found message
unconditionally
Author: mirabilos <tg@debian.org>
Forwarded: not-needed
--- a/libmscore/score.cpp
+++ b/libmscore/score.cpp
@@ -288,6 +288,7 @@ void Score::init()
_pageNumberOffset = 0;
_mscVersion = MSCVERSION;
+ _isloading = false;
_created = false;
_updateAll = true;
@@ -1354,7 +1355,7 @@ Measure* Score::getCreateMeasure(int tic
void Score::addElement(Element* element)
{
- if (MScore::debugMode) {
+ if (!_isloading && MScore::debugMode) {
qDebug(" Score(%p)::addElement %p(%s) parent %p(%s)",
this, element, element->name(), element->parent(),
element->parent() ? element->parent()->name() : "");
--- a/libmscore/score.h
+++ b/libmscore/score.h
@@ -352,6 +352,7 @@ class Score : public QObject, public Sco
MStyle _style;
QFileInfo info;
+ bool _isloading;
bool _created; ///< file is never saved, has generated name
QString _tmpName; ///< auto saved with this name if not empty
QString _importedFilePath; // file from which the score was imported, or empty
@@ -491,6 +492,7 @@ class Score : public QObject, public Sco
FileError loadCompressedMsc(QIODevice*, bool ignoreVersionError);
FileError read114(XmlReader&);
FileError read1(XmlReader&, bool ignoreVersionError);
+ FileError read1w(XmlReader&, bool ignoreVersionError);
void renderStaff(EventMap* events, Staff*);
void renderSpanners(EventMap* events);
--- a/libmscore/scorefile.cpp
+++ b/libmscore/scorefile.cpp
@@ -905,6 +905,20 @@ void Score::parseVersion(const QString&
Score::FileError Score::read1(XmlReader& e, bool ignoreVersionError)
{
+ _isloading = true;
+ try {
+ Score::FileError result = read1w(e, ignoreVersionError);
+ _isloading = false;
+ return result;
+ }
+ catch (...) {
+ _isloading = false;
+ throw;
+ }
+ }
+
+Score::FileError Score::read1w(XmlReader& e, bool ignoreVersionError)
+ {
_elinks.clear();
while (e.readNextStartElement()) {
@@ -1085,7 +1099,7 @@ bool Score::read(XmlReader& e)
else if (tag == "Style") {
qreal sp = _style.spatium();
_style.load(e);
- // if (_layoutMode == LayoutMode::FLOAT || _layoutMode == LayoutMode::SYSTEM) {
+ // if (_layoutMode == LayoutMode::FLOAT || _layoutMode == LayoutMode::SYSTEM)
if (_layoutMode == LayoutMode::FLOAT) {
// style should not change spatium in
// float mode
--- a/libmscore/spannermap.cpp
+++ b/libmscore/spannermap.cpp
@@ -96,7 +96,9 @@ bool SpannerMap::removeSpanner(Spanner*
return true;
}
}
+#if 0
qDebug("Score::removeSpanner: %s (%p) not found", s->name(), s);
+#endif
return false;
}
|