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:
@@ -67,7 +67,7 @@ protected:
|
|||||||
if (url.scheme().isEmpty()) {
|
if (url.scheme().isEmpty()) {
|
||||||
// Resolve it relative to root
|
// Resolve it relative to root
|
||||||
if (root.isLocalFile())
|
if (root.isLocalFile())
|
||||||
return root.resolved(QUrl::fromLocalFile(line));
|
return QUrl::fromUserInput(line, root.adjusted(QUrl::RemoveFilename).toLocalFile(), QUrl::AssumeLocalFile);
|
||||||
else
|
else
|
||||||
return root.resolved(url);
|
return root.resolved(url);
|
||||||
} else if (url.scheme().length() == 1) {
|
} else if (url.scheme().length() == 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user