From 77ed783f38e68668e6ba0b4cb922b204c168524b Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@qt.io>
Date: Wed, 29 Mar 2017 16:58:09 +0200
Subject: [PATCH] DemoBrowser: Fix use of system proxy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The example did always set an application proxy, though it
was empty if no proxy was explicitly set in the system. This
however blocked the use of the system settings.

Task-number: QTBUG-58748
Change-Id: I50d9116e491cb7c1ab5b8fc610736d60e0bc9ea8
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 examples/webenginewidgets/demobrowser/browserapplication.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/webenginewidgets/demobrowser/browserapplication.cpp b/examples/webenginewidgets/demobrowser/browserapplication.cpp
index 995626bb9..32429a675 100644
--- a/examples/webenginewidgets/demobrowser/browserapplication.cpp
+++ b/examples/webenginewidgets/demobrowser/browserapplication.cpp
@@ -332,8 +332,8 @@ void BrowserApplication::loadSettings()
         proxy.setPort(settings.value(QLatin1String("port"), 1080).toInt());
         proxy.setUser(settings.value(QLatin1String("userName")).toString());
         proxy.setPassword(settings.value(QLatin1String("password")).toString());
+        QNetworkProxy::setApplicationProxy(proxy);
     }
-    QNetworkProxy::setApplicationProxy(proxy);
     settings.endGroup();
 }
 
-- 
GitLab