ASX Parser: Remove out XML declaration and starting whitespace.

This commit is contained in:
James D. Smith 2022-03-18 16:38:36 -06:00
parent edfc2666ab
commit f1c6377cfa
1 changed files with 3 additions and 4 deletions

View File

@ -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) {
@ -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 {