QPlaylistFileParser: fix QUrl::resolved+QUrl::fromLocalFile misuse

QUrl::resolved can be used to resolve relative paths, but not by
passing them via QUrl::fromLocalFile (8a33077 in qtbase made QUrl
more strict). To resolve both relative and absolute local paths
against a local directory, QUrl::fromUserInput(3 args) does the job.

Change-Id: Ifc01bbd590978f939f9538e70d12f2f3704d7b5d
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
This commit is contained in:
David Faure
2016-08-04 14:16:05 +02:00
committed by Yoann Lopes
parent d7d31d63db
commit 5b9384336c

View File

@@ -67,7 +67,7 @@ protected:
if (url.scheme().isEmpty()) {
// Resolve it relative to root
if (root.isLocalFile())
return root.resolved(QUrl::fromLocalFile(line));
return QUrl::fromUserInput(line, root.adjusted(QUrl::RemoveFilename).toLocalFile(), QUrl::AssumeLocalFile);
else
return root.resolved(url);
} else if (url.scheme().length() == 1) {