[SOLVED]
Replace
playlist->load(QUrl::fromLocalFile("C:/Users/Marco/Music/default.m3u"), "m3u");
with
QFile inputFile("C:/Users/Marco/Music/default.m3u");
if (inputFile.open(QIODevice::ReadOnly))
{
QTextStream in(&inputFile);
in.setCodec("UTF-8");
while (!in.atEnd())
{
QString line = in.readLine().trimmed().toUtf8().constData();
playlist->addMedia(QUrl(QFileInfo(line).filePath()));
}
inputFile.close();
}
and
playlist->save(QUrl::fromLocalFile("C:/Users/Marco/Music/default.m3u"), "m3u");
with
QFile outputFile("C:/Users/Marco/Music/default.m3u");
outputFile.open(QIODevice::WriteOnly|QIODevice::Text);
for (int i=0; i < playlist->mediaCount(); i++) {
//…
QTextStream out(&outputFile);
out << mediafile[0].toUpper()+mediafile.mid(1) << endl;
//…
}
outputFile.close();