summaryrefslogtreecommitdiff
blob: 7158c6420c920cc0316c2ea7a069fd862ecc57d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- old/src/plugins/PlaylistFormats/xspf/xspfplaylistformat.cpp     (revision 736)
+++ new/src/plugins/PlaylistFormats/xspf/xspfplaylistformat.cpp     (revision 737)
@@ -57,11 +57,13 @@

     while (!child.isNull())
     {
-        QString str = QUrl(child.firstChildElement("location").text()).toString(QUrl::RemoveScheme);
-        out << str;
+        QUrl url (child.firstChildElement("location").text());
+        if (url.scheme() == "file")  //remove scheme for local files only
+            out << url.toString(QUrl::RemoveScheme);
+        else
+            out << url.toString();
         child = child.nextSiblingElement();
     }
-
     return out;
 }

@@ -87,7 +89,11 @@
         QDomElement track = doc.createElement("track");

         QDomElement ch = doc.createElement("location");
-        QDomText text = doc.createTextNode(/*QString("file://") + */QFileInfo(f->path()).absoluteFilePath());
+        QDomText text;
+        if (f->path().contains("://"))
+            text = doc.createTextNode(f->path());
+        else  //append protocol
+            text = doc.createTextNode(QString("file://") + QFileInfo(f->path()).absoluteFilePath());
         ch.appendChild(text);
         track.appendChild(ch);