mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 17:37:36 +03:00
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 <roeland@famdouma.nl>
This commit is contained in:
parent
af443461e3
commit
eb3245b241
2 changed files with 12 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
#include <QWebEngineUrlRequestJob>
|
||||
#include <QProgressBar>
|
||||
#include <QVBoxLayout>
|
||||
#include <QNetworkProxyFactory>
|
||||
|
||||
#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";
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue