QDesktopServices: don't use openDocument if the URL has a query
[ChangeLog][QtGui][QDesktopServices] Fixed a bug that caused QDesktopServices::openUrl() to discard a query when opening a local file URL that contained a query but no fragment. Pick-to: 6.9 6.8 Fixes: QTBUG-133663 Change-Id: Ie8fa190036417f590540fffdcf03e53f3c99b38f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
0cc41083c3
commit
aad0ab897f
@ -177,9 +177,9 @@ bool QDesktopServices::openUrl(const QUrl &url)
|
|||||||
qWarning("The platform plugin does not support services.");
|
qWarning("The platform plugin does not support services.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// We only use openDocument if there is no fragment for the URL to
|
// We only use openDocument if there is no fragment or query for the URL to
|
||||||
// avoid it being lost when using openDocument
|
// avoid it being lost when using openDocument
|
||||||
if (url.isLocalFile() && !url.hasFragment())
|
if (url.isLocalFile() && !url.hasFragment() && !url.hasQuery())
|
||||||
return platformServices->openDocument(url);
|
return platformServices->openDocument(url);
|
||||||
return platformServices->openUrl(url);
|
return platformServices->openUrl(url);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user