Skip to content

Commit

Permalink
ASX Parser: Remove out XML declaration and starting whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
smithjd15 committed Mar 18, 2022
1 parent c69a64d commit dcd7c76
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/playlistparsers/asxparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,11 @@ void ASXParser::Save(const SongList& songs, QIODevice* device, const QDir&,
s.endGroup();

QXmlStreamWriter writer(device);
writer.writeStartElement("asx");
writer.writeAttribute("version", "3.0");
writer.setAutoFormatting(true);
writer.setAutoFormattingIndent(2);
writer.writeStartDocument();
{
StreamElement asx("asx", &writer);
writer.writeAttribute("version", "3.0");
for (const Song& song : songs) {
StreamElement entry("entry", &writer);
if (!song.title().isEmpty() && writeMetadata) {
Expand All @@ -146,7 +145,7 @@ void ASXParser::Save(const SongList& songs, QIODevice* device, const QDir&,
}
}
}
writer.writeEndDocument();
writer.writeEndElement();
}

bool ASXParser::TryMagic(const QByteArray& data) const {
Expand Down

0 comments on commit dcd7c76

Please sign in to comment.