Disable automatic conversions from 8-bit strings
This commit is contained in:
@@ -68,9 +68,9 @@ void WplParser::ParseSeq(const QDir &dir, QXmlStreamReader *reader, SongList *so
|
||||
QXmlStreamReader::TokenType type = reader->readNext();
|
||||
QString name = reader->name().toString();
|
||||
switch (type) {
|
||||
case QXmlStreamReader::StartElement: {
|
||||
if (name == "media") {
|
||||
QString src = reader->attributes().value("src").toString();
|
||||
case QXmlStreamReader::StartElement:{
|
||||
if (name == QStringLiteral("media")) {
|
||||
QString src = reader->attributes().value(QStringLiteral("src")).toString();
|
||||
if (!src.isEmpty()) {
|
||||
Song song = LoadSong(src, 0, 0, dir, collection_search);
|
||||
if (song.is_valid()) {
|
||||
@@ -83,8 +83,8 @@ void WplParser::ParseSeq(const QDir &dir, QXmlStreamReader *reader, SongList *so
|
||||
}
|
||||
break;
|
||||
}
|
||||
case QXmlStreamReader::EndElement: {
|
||||
if (name == "seq") {
|
||||
case QXmlStreamReader::EndElement:{
|
||||
if (name == QStringLiteral("seq")) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -101,13 +101,13 @@ void WplParser::Save(const SongList &songs, QIODevice *device, const QDir &dir,
|
||||
QXmlStreamWriter writer(device);
|
||||
writer.setAutoFormatting(true);
|
||||
writer.setAutoFormattingIndent(2);
|
||||
writer.writeProcessingInstruction("wpl", "version=\"1.0\"");
|
||||
writer.writeProcessingInstruction(QStringLiteral("wpl"), QStringLiteral("version=\"1.0\""));
|
||||
|
||||
StreamElement smil(QStringLiteral("smil"), &writer);
|
||||
|
||||
{
|
||||
StreamElement head(QStringLiteral("head"), &writer);
|
||||
WriteMeta(QStringLiteral("Generator"), "Strawberry -- " STRAWBERRY_VERSION_DISPLAY, &writer);
|
||||
WriteMeta(QStringLiteral("Generator"), QStringLiteral("Strawberry -- ") + QLatin1String(STRAWBERRY_VERSION_DISPLAY), &writer);
|
||||
WriteMeta(QStringLiteral("ItemCount"), QString::number(songs.count()), &writer);
|
||||
}
|
||||
|
||||
@@ -116,8 +116,8 @@ void WplParser::Save(const SongList &songs, QIODevice *device, const QDir &dir,
|
||||
{
|
||||
StreamElement seq(QStringLiteral("seq"), &writer);
|
||||
for (const Song &song : songs) {
|
||||
writer.writeStartElement("media");
|
||||
writer.writeAttribute("src", URLOrFilename(song.url(), dir, path_type));
|
||||
writer.writeStartElement(QStringLiteral("media"));
|
||||
writer.writeAttribute(QStringLiteral("src"), URLOrFilename(song.url(), dir, path_type));
|
||||
writer.writeEndElement();
|
||||
}
|
||||
}
|
||||
@@ -126,9 +126,9 @@ void WplParser::Save(const SongList &songs, QIODevice *device, const QDir &dir,
|
||||
|
||||
void WplParser::WriteMeta(const QString &name, const QString &content, QXmlStreamWriter *writer) {
|
||||
|
||||
writer->writeStartElement("meta");
|
||||
writer->writeAttribute("name", name);
|
||||
writer->writeAttribute("content", content);
|
||||
writer->writeStartElement(QStringLiteral("meta"));
|
||||
writer->writeAttribute(QStringLiteral("name"), name);
|
||||
writer->writeAttribute(QStringLiteral("content"), content);
|
||||
writer->writeEndElement();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user