From aa167f22dbbeb4c2b680bc860dbc409d5a447864 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 30 Apr 2018 18:29:11 +0000 Subject: changed playlist API, fixed some issues git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7940 90c681e8-e032-0410-971d-27865f9a5e38 --- .../PlayListFormats/xspf/xspfplaylistformat.cpp | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/plugins/PlayListFormats/xspf/xspfplaylistformat.cpp') diff --git a/src/plugins/PlayListFormats/xspf/xspfplaylistformat.cpp b/src/plugins/PlayListFormats/xspf/xspfplaylistformat.cpp index f20c83903..7a66bc7bb 100644 --- a/src/plugins/PlayListFormats/xspf/xspfplaylistformat.cpp +++ b/src/plugins/PlayListFormats/xspf/xspfplaylistformat.cpp @@ -72,29 +72,29 @@ QList XSPFPlaylistFormat::decode(const QByteArray &contents) { QUrl url(xml.text().toString()); if (url.scheme() == "file") //remove scheme for local files only - out.last()->insert(Qmmp::URL, QUrl::fromPercentEncoding(url.toString().toLatin1()).remove("file://")); + out.last()->setPath(QUrl::fromPercentEncoding(url.toString().toLatin1()).remove("file://")); else - out.last()->insert(Qmmp::URL, QUrl::fromPercentEncoding(url.toString().toLatin1())); + out.last()->setPath(QUrl::fromPercentEncoding(url.toString().toLatin1())); } else if(currentTag == "title") { - out.last()->insert(Qmmp::TITLE, xml.text().toString()); + out.last()->setValue(Qmmp::TITLE, xml.text().toString()); } else if(currentTag == "creator") { - out.last()->insert(Qmmp::ARTIST, xml.text().toString()); + out.last()->setValue(Qmmp::ARTIST, xml.text().toString()); } else if(currentTag == "annotation") { - out.last()->insert(Qmmp::COMMENT, xml.text().toString()); + out.last()->setValue(Qmmp::COMMENT, xml.text().toString()); } else if(currentTag == "album") { - out.last()->insert(Qmmp::ALBUM, xml.text().toString()); + out.last()->setValue(Qmmp::ALBUM, xml.text().toString()); } else if(currentTag == "meta" && xml.attributes().value("rel") == "year") { - out.last()->insert(Qmmp::YEAR, xml.text().toString()); + out.last()->setValue(Qmmp::YEAR, xml.text().toString()); } else xml.skipCurrentElement(); @@ -131,13 +131,13 @@ QByteArray XSPFPlaylistFormat::encode(const QList &files, const xml.writeStartElement("track"); QString url; - if (f->url().contains("://")) + if (f->path().contains("://")) { - url = QUrl::toPercentEncoding(f->url(), ":/"); + url = QUrl::toPercentEncoding(f->path(), ":/"); } - else if(f->url().startsWith(xspfDir)) //relative path + else if(f->path().startsWith(xspfDir)) //relative path { - QString p = f->url(); + QString p = f->path(); p.remove(0, xspfDir.size()); if(p.startsWith("/")) p.remove(0, 1); @@ -145,7 +145,7 @@ QByteArray XSPFPlaylistFormat::encode(const QList &files, const } else //absolute path { - url = QUrl::toPercentEncoding(QLatin1String("file://") + f->url(), ":/"); + url = QUrl::toPercentEncoding(QLatin1String("file://") + f->path(), ":/"); } xml.writeTextElement("location", url); -- cgit v1.2.3-13-gbd6f