diff options
author | Michael Goddard <michael.goddard@nokia.com> | 2012-04-20 15:18:04 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-20 07:52:09 +0200 |
commit | e657397f666824b0ce7a96de350a7fdb31a4e8f8 (patch) | |
tree | d30fde3a3716f29b9b0f0e29ee57b1d06a50c2c9 /src/multimedia/playback/playlistfileparser.cpp | |
parent | ebe568f2b1ae9f2f8f1a0579b07287e696b09376 (diff) |
Adjust to changed QUrl::isRelative() semantics.
Paths with a leading slash were previously considered relative (with
no scheme) but now they aren't. So take the opportunity to tweak the
path resolution code
Change-Id: I7b02cb85403ebb151dba274db0c05459ef536f18
Reviewed-by: Lev Zelenskiy <lev.zelenskiy@nokia.com>
Reviewed-by: Ling Hu <ling.hu@nokia.com>
Diffstat (limited to 'src/multimedia/playback/playlistfileparser.cpp')
-rw-r--r-- | src/multimedia/playback/playlistfileparser.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/multimedia/playback/playlistfileparser.cpp b/src/multimedia/playback/playlistfileparser.cpp index 11fe5a232..d06f31304 100644 --- a/src/multimedia/playback/playlistfileparser.cpp +++ b/src/multimedia/playback/playlistfileparser.cpp @@ -148,12 +148,22 @@ public: QUrl expandToFullPath(const QUrl& root, const QString& line) { + // On Linux, backslashes are not converted to forward slashes :/ + if (line.startsWith(QLatin1String("//")) || line.startsWith(QLatin1String("\\\\"))) { + // Network share paths are not resolved + return QUrl::fromLocalFile(line); + } + QUrl url(line); - if (url.isRelative()) { + if (url.scheme().isEmpty()) { + // Resolve it relative to root if (root.isLocalFile()) return root.resolved(QUrl::fromLocalFile(line)); else return root.resolved(url); + } else if (url.scheme().length() == 1) { + // Assume it's a drive letter for a Windows path + url = QUrl::fromLocalFile(line); } return url; |