summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_context.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2020-02-20 18:00:18 +0100
committerMichal Klocek <michal.klocek@qt.io>2020-03-13 14:54:19 +0100
commit22c3bfa462eb6e3785eeda1a6540b09a9ae9fd67 (patch)
treeb382ce092cb83179029adf67fa56a26400acfd2a /src/core/web_engine_context.cpp
parent71c3f0a1f8decdd6ba43afb79fa23ee2dc8c743e (diff)
Add support for qrc proxy pac file
Change-Id: Ic4b70d31c85a31a434644c311eb173cda6a82fbd Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r--src/core/web_engine_context.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 708fdaa74..55a9cc4a6 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -221,8 +221,13 @@ bool usingSoftwareDynamicGL()
void setupProxyPac(base::CommandLine *commandLine){
if (commandLine->HasSwitch(switches::kProxyPacUrl)) {
QUrl pac_url(toQt(commandLine->GetSwitchValueASCII(switches::kProxyPacUrl)));
- if (pac_url.isValid() && pac_url.isLocalFile()) {
- QFile file(pac_url.toLocalFile());
+ if (pac_url.isValid() && (pac_url.isLocalFile() ||
+ !pac_url.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive))) {
+ QFile file;
+ if (pac_url.isLocalFile())
+ file.setFileName(pac_url.toLocalFile());
+ else
+ file.setFileName(pac_url.path().prepend(QChar(':')));
if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QByteArray ba = file.readAll();
commandLine->RemoveSwitch(switches::kProxyPacUrl);