mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 05:55:59 +03:00
Merge pull request #1057 from nextcloud/fix/proxy-login-flow
Fix login flow with system proxy
This commit is contained in:
commit
822c386709
3 changed files with 43 additions and 23 deletions
|
@ -80,8 +80,16 @@ void ClientProxy::setupQtProxyFromConfig()
|
||||||
QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy);
|
QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy);
|
||||||
break;
|
break;
|
||||||
case QNetworkProxy::DefaultProxy:
|
case QNetworkProxy::DefaultProxy:
|
||||||
qCInfo(lcClientProxy) << "Set proxy configuration to use system configuration";
|
qCInfo(lcClientProxy) << "Set proxy configuration to use the prefered system proxy for http tcp connections";
|
||||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
{
|
||||||
|
QNetworkProxyQuery query;
|
||||||
|
query.setProtocolTag("http");
|
||||||
|
query.setQueryType(QNetworkProxyQuery::TcpSocket);
|
||||||
|
auto proxies = QNetworkProxyFactory::proxyForQuery(query);
|
||||||
|
proxy = proxies.first();
|
||||||
|
}
|
||||||
|
QNetworkProxyFactory::setUseSystemConfiguration(false);
|
||||||
|
QNetworkProxy::setApplicationProxy(proxy);
|
||||||
break;
|
break;
|
||||||
case QNetworkProxy::Socks5Proxy:
|
case QNetworkProxy::Socks5Proxy:
|
||||||
proxy.setType(QNetworkProxy::Socks5Proxy);
|
proxy.setType(QNetworkProxy::Socks5Proxy);
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include <QWebEngineUrlRequestJob>
|
#include <QWebEngineUrlRequestJob>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
#include <QNetworkProxyFactory>
|
||||||
|
|
||||||
#include "owncloudwizard.h"
|
#include "owncloudwizard.h"
|
||||||
#include "creds/webflowcredentials.h"
|
#include "creds/webflowcredentials.h"
|
||||||
|
@ -27,9 +28,17 @@ WebViewPage::WebViewPage(QWidget *parent)
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
connect(_webView, &WebView::urlCatched, this, &WebViewPage::urlCatched);
|
connect(_webView, &WebView::urlCatched, this, &WebViewPage::urlCatched);
|
||||||
|
|
||||||
|
//_useSystemProxy = QNetworkProxyFactory::usesSystemConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
|
WebViewPage::~WebViewPage() {
|
||||||
|
//QNetworkProxyFactory::setUseSystemConfiguration(_useSystemProxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebViewPage::initializePage() {
|
void WebViewPage::initializePage() {
|
||||||
|
//QNetworkProxy::setApplicationProxy(QNetworkProxy::applicationProxy());
|
||||||
|
|
||||||
QString url;
|
QString url;
|
||||||
if (_ocWizard->registration()) {
|
if (_ocWizard->registration()) {
|
||||||
url = "https://nextcloud.com/register";
|
url = "https://nextcloud.com/register";
|
||||||
|
|
|
@ -14,6 +14,7 @@ class WebViewPage : public AbstractCredentialsWizardPage
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
WebViewPage(QWidget *parent = nullptr);
|
WebViewPage(QWidget *parent = nullptr);
|
||||||
|
~WebViewPage();
|
||||||
|
|
||||||
void initializePage() override;
|
void initializePage() override;
|
||||||
int nextId() const override;
|
int nextId() const override;
|
||||||
|
@ -34,6 +35,8 @@ private:
|
||||||
|
|
||||||
QString _user;
|
QString _user;
|
||||||
QString _pass;
|
QString _pass;
|
||||||
|
|
||||||
|
bool _useSystemProxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue