From eb3245b24170282d0565958b7f0a5238a5d96a43 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 30 Jan 2019 22:48:40 +0100 Subject: [PATCH] Fix login flow with system proxy I must admit why this works is puzzling me. However if I just use a system proxy without this it doesn't work. I suspect a Qt bug but will have to dig deeper to find out if that is the case. For now this little hack will have to do. Signed-off-by: Roeland Jago Douma --- src/gui/wizard/webviewpage.cpp | 9 +++++++++ src/gui/wizard/webviewpage.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/gui/wizard/webviewpage.cpp b/src/gui/wizard/webviewpage.cpp index 45028f6a5..f9deeb83f 100644 --- a/src/gui/wizard/webviewpage.cpp +++ b/src/gui/wizard/webviewpage.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "owncloudwizard.h" #include "creds/webflowcredentials.h" @@ -27,9 +28,17 @@ WebViewPage::WebViewPage(QWidget *parent) setLayout(layout); connect(_webView, &WebView::urlCatched, this, &WebViewPage::urlCatched); + + _useSystemProxy = QNetworkProxyFactory::usesSystemConfiguration(); +} + +WebViewPage::~WebViewPage() { + QNetworkProxyFactory::setUseSystemConfiguration(_useSystemProxy); } void WebViewPage::initializePage() { + QNetworkProxy::setApplicationProxy(QNetworkProxy::applicationProxy()); + QString url; if (_ocWizard->registration()) { url = "https://nextcloud.com/register"; diff --git a/src/gui/wizard/webviewpage.h b/src/gui/wizard/webviewpage.h index 76735aaef..65f00c33b 100644 --- a/src/gui/wizard/webviewpage.h +++ b/src/gui/wizard/webviewpage.h @@ -14,6 +14,7 @@ class WebViewPage : public AbstractCredentialsWizardPage Q_OBJECT public: WebViewPage(QWidget *parent = nullptr); + ~WebViewPage(); void initializePage() override; int nextId() const override; @@ -34,6 +35,8 @@ private: QString _user; QString _pass; + + bool _useSystemProxy; }; }