diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-09-15 10:06:39 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-03-17 10:39:00 +0000 |
commit | f33badbaa421b3a042af848110147547840eed4d (patch) | |
tree | 03939104b9a0906d7655b777d490e4202fd006bf /src/core/api/qwebenginescript.cpp | |
parent | 237f70db66439a7b8e45bc6c48a600b9b13363a6 (diff) | |
download | qtwebengine-f33badbaa421b3a042af848110147547840eed4d.tar.gz |
Fix qrc sources for QWebEngineScript
Fixes: QTBUG-96525
Change-Id: I39d6247c0dd0e55e4fb91b176f34e676eeabbcdd
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit ce2d6a94ce99f8d6f82fbcbf45603f8eb7a92957)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/core/api/qwebenginescript.cpp')
-rw-r--r-- | src/core/api/qwebenginescript.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/api/qwebenginescript.cpp b/src/core/api/qwebenginescript.cpp index f23e91ea5..e414a8a6f 100644 --- a/src/core/api/qwebenginescript.cpp +++ b/src/core/api/qwebenginescript.cpp @@ -181,12 +181,11 @@ void QWebEngineScript::setSourceUrl(const QUrl &url) d->setSourceUrl(url); QFile file; - if (url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive) == 0) { + if (url.isLocalFile()) { + file.setFileName(url.toLocalFile()); + } else if (url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive) == 0) { if (url.authority().isEmpty()) file.setFileName(QLatin1Char(':') + url.path()); - return; - } else { - file.setFileName(url.toLocalFile()); } if (!file.open(QIODevice::ReadOnly)) { |