Skip to content

Commit

Permalink
move xmlstream and qzip into thirdparty
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed May 7, 2014
1 parent c20b96e commit 2bf549b
Show file tree
Hide file tree
Showing 21 changed files with 1,270 additions and 1,277 deletions.
5 changes: 3 additions & 2 deletions libmscore/CMakeLists.txt
Expand Up @@ -75,13 +75,14 @@ add_library (
tempo.cpp sig.cpp pos.cpp fraction.cpp duration.cpp
figuredbass.cpp rehearsalmark.cpp transpose.cpp
property.cpp range.cpp elementmap.cpp notedot.cpp imageStore.cpp
qzip.cpp audio.cpp splitMeasure.cpp joinMeasure.cpp
audio.cpp splitMeasure.cpp joinMeasure.cpp
cursor.cpp read114.cpp paste.cpp
bsymbol.cpp marker.cpp jump.cpp stemslash.cpp ledgerline.cpp
synthesizerstate.cpp mcursor.cpp groups.cpp mscoreview.cpp
noteline.cpp spannermap.cpp
bagpembell.cpp ambitus.cpp
xmlstream.cpp xmlutils.cpp
../thirdparty/qzip/qzip.cpp
../thirdparty/xmlstream/xmlstream.cpp ../thirdparty/xmlstream/xmlutils.cpp
)
if (SCRIPT_INTERFACE)
set_target_properties (
Expand Down
2 changes: 1 addition & 1 deletion libmscore/read114.cpp
Expand Up @@ -440,7 +440,7 @@ Score::FileError Score::read114(XmlReader& e)
e.unknown();
}

if (e.error() != QXmlStreamReader::NoError)
if (e.error() != XmlStreamReader::NoError)
return FILE_BAD_FORMAT;

int n = nstaves();
Expand Down
6 changes: 3 additions & 3 deletions libmscore/scorefile.cpp
Expand Up @@ -43,8 +43,8 @@
#include "imageStore.h"
#include "audio.h"
#include "barline.h"
#include "libmscore/qzipreader_p.h"
#include "libmscore/qzipwriter_p.h"
#include "thirdparty/qzip/qzipreader_p.h"
#include "thirdparty/qzip/qzipwriter_p.h"
#ifdef Q_OS_WIN
#include <windows.h>
#include <stdio.h>
Expand Down Expand Up @@ -1074,7 +1074,7 @@ bool Score::read(XmlReader& e)
else
e.unknown();
}
if (e.error() != QXmlStreamReader::NoError) {
if (e.error() != XmlStreamReader::NoError) {
qDebug("%s: xml read error at line %lld col %lld: %s",
qPrintable(e.getDocName()), e.lineNumber(), e.columnNumber(),
e.name().toUtf8().data());
Expand Down
38 changes: 19 additions & 19 deletions libmscore/xml.cpp
Expand Up @@ -83,14 +83,14 @@ bool XmlReader::hasAttribute(const char* s) const

QPointF XmlReader::readPoint()
{
Q_ASSERT(tokenType() == QXmlStreamReader::StartElement);
Q_ASSERT(tokenType() == XmlStreamReader::StartElement);
#ifndef NDEBUG
if (!attributes().hasAttribute("x")) {
QXmlStreamAttributes map = attributes();
XmlStreamAttributes map = attributes();
qDebug("XmlReader::readPoint: x attribute missing: %s (%d)",
name().toUtf8().data(), map.size());
for (int i = 0; i < map.size(); ++i) {
const QXmlStreamAttribute& a = map.at(i);
const XmlStreamAttribute& a = map.at(i);
qDebug(" attr <%s> <%s>", a.name().toUtf8().data(), a.value().toUtf8().data());
}
unknown();
Expand All @@ -112,7 +112,7 @@ QPointF XmlReader::readPoint()

QColor XmlReader::readColor()
{
Q_ASSERT(tokenType() == QXmlStreamReader::StartElement);
Q_ASSERT(tokenType() == XmlStreamReader::StartElement);
QColor c;
c.setRed(intAttribute("r"));
c.setGreen(intAttribute("g"));
Expand All @@ -128,7 +128,7 @@ QColor XmlReader::readColor()

QSizeF XmlReader::readSize()
{
Q_ASSERT(tokenType() == QXmlStreamReader::StartElement);
Q_ASSERT(tokenType() == XmlStreamReader::StartElement);
QSizeF p;
p.setWidth(doubleAttribute("w", 0.0));
p.setHeight(doubleAttribute("h", 0.0));
Expand All @@ -142,7 +142,7 @@ QSizeF XmlReader::readSize()

QRectF XmlReader::readRect()
{
Q_ASSERT(tokenType() == QXmlStreamReader::StartElement);
Q_ASSERT(tokenType() == XmlStreamReader::StartElement);
QRectF p;
p.setX(doubleAttribute("x", 0.0));
p.setY(doubleAttribute("y", 0.0));
Expand All @@ -158,7 +158,7 @@ QRectF XmlReader::readRect()

Fraction XmlReader::readFraction()
{
Q_ASSERT(tokenType() == QXmlStreamReader::StartElement);
Q_ASSERT(tokenType() == XmlStreamReader::StartElement);
int z = attribute("z", "0").toInt();
int n = attribute("n", "0").toInt();
skipCurrentElement();
Expand All @@ -172,7 +172,7 @@ Fraction XmlReader::readFraction()

void XmlReader::unknown() const
{
if (QXmlStreamReader::error())
if (XmlStreamReader::error())
qDebug("StreamReaderError: %s", qPrintable(errorString()));
qFatal("%s: xml read error at line %lld col %lld: %s",
qPrintable(docName), lineNumber(), columnNumber(),
Expand Down Expand Up @@ -625,25 +625,25 @@ void Xml::dump(int len, const unsigned char* p)
void XmlReader::htmlToString(int level, QString* s)
{
*s += QString("<%1").arg(name().toString());
for (const QXmlStreamAttribute& a : attributes())
for (const XmlStreamAttribute& a : attributes())
*s += QString(" %1=\"%2\"").arg(a.name().toString()).arg(a.value().toString());
*s += ">";
++level;
for (;;) {
QXmlStreamReader::TokenType t = readNext();
XmlStreamReader::TokenType t = readNext();
switch(t) {
case QXmlStreamReader::StartElement:
case XmlStreamReader::StartElement:
htmlToString(level, s);
break;
case QXmlStreamReader::EndElement:
case XmlStreamReader::EndElement:
*s += QString("</%1>").arg(name().toString());
--level;
return;
case QXmlStreamReader::Characters:
case XmlStreamReader::Characters:
if (!isWhitespace())
*s += text().toString().toHtmlEscaped();
break;
case QXmlStreamReader::Comment:
case XmlStreamReader::Comment:
break;

default:
Expand All @@ -663,18 +663,18 @@ QString XmlReader::readXml()
QString s;
int level = 1;
for (;;) {
QXmlStreamReader::TokenType t = readNext();
XmlStreamReader::TokenType t = readNext();
switch(t) {
case QXmlStreamReader::StartElement:
case XmlStreamReader::StartElement:
htmlToString(level, &s);
break;
case QXmlStreamReader::EndElement:
case XmlStreamReader::EndElement:
return s;
case QXmlStreamReader::Characters:
case XmlStreamReader::Characters:
if (!isWhitespace())
s += text().toString().toHtmlEscaped();
break;
case QXmlStreamReader::Comment:
case XmlStreamReader::Comment:
break;

default:
Expand Down
12 changes: 6 additions & 6 deletions libmscore/xml.h
Expand Up @@ -13,7 +13,7 @@
#ifndef __XML_H__
#define __XML_H__

#include "xmlstream.h"
#include "thirdparty/xmlstream/xmlstream.h"
#include "mscore.h"
#include "spatium.h"
#include "fraction.h"
Expand Down Expand Up @@ -43,7 +43,7 @@ struct SpannerValues {
// XmlReader
//---------------------------------------------------------

class XmlReader : public QXmlStreamReader {
class XmlReader : public XmlStreamReader {
QString docName; // used for error reporting

// Score read context (for read optimizations):
Expand All @@ -58,10 +58,10 @@ class XmlReader : public QXmlStreamReader {
Interval _transpose;

public:
XmlReader(QFile* f) : QXmlStreamReader(f), docName(f->fileName()) {}
XmlReader(const QByteArray& d, const QString& s = QString()) : QXmlStreamReader(d), docName(s) {}
XmlReader(QIODevice* d, const QString& s = QString()) : QXmlStreamReader(d), docName(s) {}
XmlReader(const QString& d, const QString& s = QString()) : QXmlStreamReader(d), docName(s) {}
XmlReader(QFile* f) : XmlStreamReader(f), docName(f->fileName()) {}
XmlReader(const QByteArray& d, const QString& s = QString()) : XmlStreamReader(d), docName(s) {}
XmlReader(QIODevice* d, const QString& s = QString()) : XmlStreamReader(d), docName(s) {}
XmlReader(const QString& d, const QString& s = QString()) : XmlStreamReader(d), docName(s) {}

void unknown() const;

Expand Down
2 changes: 1 addition & 1 deletion mscore/capxml.cpp
Expand Up @@ -25,7 +25,7 @@

#include <assert.h>
#include "libmscore/score.h"
#include "libmscore/qzipreader_p.h"
#include "thirdparty/qzip/qzipreader_p.h"
#include "capella.h"

namespace Ms {
Expand Down
8 changes: 4 additions & 4 deletions mscore/exportxml.cpp
Expand Up @@ -93,7 +93,7 @@
#include "libmscore/figuredbass.h"
#include "libmscore/stringdata.h"
#include "libmscore/rehearsalmark.h"
#include "libmscore/qzipwriter_p.h"
#include "thirdparty/qzip/qzipwriter_p.h"
#include "libmscore/fret.h"
#include "libmscore/tie.h"

Expand Down Expand Up @@ -233,7 +233,7 @@ class SlurHandler {

public:
SlurHandler();
void doSlurStart(Chord* chord, Notations& notations, Xml& xml, bool grace = false);
void doSlurStart(Chord* chord, Notations& notations, Xml& xml, bool grace = false);
void doSlurStop(Chord* chord, Notations& notations, Xml& xml);
};

Expand Down Expand Up @@ -447,7 +447,7 @@ int SlurHandler::findSlur(const Slur* s) const

void SlurHandler::doSlurStart(Chord* chord, Notations& notations, Xml& xml, bool grace)
{
// slurs on grace notes are not in spanner list, therefore:
// slurs on grace notes are not in spanner list, therefore:
if (grace){
foreach(Element* el, chord->el()){
if (el->type() == Element::SLUR){
Expand Down Expand Up @@ -2330,7 +2330,7 @@ void ExportMusicXml::chord(Chord* chord, int staff, const QList<Lyrics*>* ll, bo

if (note == nl.front()) {
if (grace){
sh.doSlurStart(chord, notations, xml, true);
sh.doSlurStart(chord, notations, xml, true);
}
else {
tupletStartStop(chord, notations, xml);
Expand Down
2 changes: 1 addition & 1 deletion mscore/importxml.cpp
Expand Up @@ -97,7 +97,7 @@
#include "libmscore/chordline.h"
#include "libmscore/figuredbass.h"
#include "libmscore/fret.h"
#include "libmscore/qzipreader_p.h"
#include "thirdparty/qzip/qzipreader_p.h"
#include "libmscore/stafftype.h"
#include "libmscore/stringdata.h"
#include "libmscore/drumset.h"
Expand Down
4 changes: 2 additions & 2 deletions mscore/palette.cpp
Expand Up @@ -34,8 +34,8 @@
#include "libmscore/icon.h"
#include "libmscore/mscore.h"
#include "libmscore/imageStore.h"
#include "libmscore/qzipreader_p.h"
#include "libmscore/qzipwriter_p.h"
#include "thirdparty/qzip/qzipreader_p.h"
#include "thirdparty/qzip/qzipwriter_p.h"
#include "libmscore/slur.h"
#include "paletteBoxButton.h"

Expand Down
4 changes: 2 additions & 2 deletions mscore/workspace.cpp
Expand Up @@ -22,8 +22,8 @@
#include "libmscore/score.h"
#include "libmscore/imageStore.h"
#include "libmscore/xml.h"
#include "libmscore/qzipreader_p.h"
#include "libmscore/qzipwriter_p.h"
#include "thirdparty/qzip/qzipreader_p.h"
#include "thirdparty/qzip/qzipwriter_p.h"
#include "preferences.h"
#include "palette.h"
#include "palettebox.h"
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions libmscore/qzipreader_p.h → thirdparty/qzip/qzipreader_p.h
Expand Up @@ -39,8 +39,8 @@
**
****************************************************************************/

#ifndef QZIPREADER_H
#define QZIPREADER_H
#ifndef __ZIPREADER_H__
#define __ZIPREADER_H__

#ifndef QT_NO_TEXTODFWRITER

Expand Down
5 changes: 3 additions & 2 deletions libmscore/qzipwriter_p.h → thirdparty/qzip/qzipwriter_p.h
Expand Up @@ -38,8 +38,9 @@
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QZIPWRITER_H
#define QZIPWRITER_H

#ifndef __ZIPWRITER_H__
#define __ZIPWRITER_H__
#ifndef QT_NO_TEXTODFWRITER

//
Expand Down
File renamed without changes.

0 comments on commit 2bf549b

Please sign in to comment.