mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 13:05:51 +03:00
Add proxy type property to account
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
2501cdf44d
commit
73dd000429
2 changed files with 22 additions and 0 deletions
|
@ -1103,4 +1103,19 @@ void Account::setNetworkProxySetting(const AccountNetworkProxySetting setting)
|
||||||
emit networkProxySettingChanged();
|
emit networkProxySettingChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QNetworkProxy::ProxyType Account::proxyType() const
|
||||||
|
{
|
||||||
|
return _proxyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Account::setProxyType(QNetworkProxy::ProxyType proxyType)
|
||||||
|
{
|
||||||
|
if (_proxyType == proxyType) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_proxyType = proxyType;
|
||||||
|
emit proxyTypeChanged();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace OCC
|
} // namespace OCC
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QNetworkCookie>
|
#include <QNetworkCookie>
|
||||||
|
#include <QNetworkProxy>
|
||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
#include <QSslSocket>
|
#include <QSslSocket>
|
||||||
#include <QSslCertificate>
|
#include <QSslCertificate>
|
||||||
|
@ -91,6 +92,7 @@ class OWNCLOUDSYNC_EXPORT Account : public QObject
|
||||||
Q_PROPERTY(bool e2eEncryptionKeysGenerationAllowed MEMBER _e2eEncryptionKeysGenerationAllowed)
|
Q_PROPERTY(bool e2eEncryptionKeysGenerationAllowed MEMBER _e2eEncryptionKeysGenerationAllowed)
|
||||||
Q_PROPERTY(bool askUserForMnemonic READ askUserForMnemonic WRITE setAskUserForMnemonic NOTIFY askUserForMnemonicChanged)
|
Q_PROPERTY(bool askUserForMnemonic READ askUserForMnemonic WRITE setAskUserForMnemonic NOTIFY askUserForMnemonicChanged)
|
||||||
Q_PROPERTY(AccountNetworkProxySetting networkProxySetting READ networkProxySetting WRITE setNetworkProxySetting NOTIFY networkProxySettingChanged)
|
Q_PROPERTY(AccountNetworkProxySetting networkProxySetting READ networkProxySetting WRITE setNetworkProxySetting NOTIFY networkProxySettingChanged)
|
||||||
|
Q_PROPERTY(QNetworkProxy::ProxyType proxyType READ proxyType WRITE setProxyType NOTIFY proxyTypeChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum class AccountNetworkProxySetting {
|
enum class AccountNetworkProxySetting {
|
||||||
|
@ -359,6 +361,9 @@ public:
|
||||||
[[nodiscard]] AccountNetworkProxySetting networkProxySetting() const;
|
[[nodiscard]] AccountNetworkProxySetting networkProxySetting() const;
|
||||||
void setNetworkProxySetting(AccountNetworkProxySetting networkProxySetting);
|
void setNetworkProxySetting(AccountNetworkProxySetting networkProxySetting);
|
||||||
|
|
||||||
|
[[nodiscard]] QNetworkProxy::ProxyType proxyType() const;
|
||||||
|
void setProxyType(QNetworkProxy::ProxyType proxyType);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/// Used when forgetting credentials
|
/// Used when forgetting credentials
|
||||||
void clearQNAMCache();
|
void clearQNAMCache();
|
||||||
|
@ -404,6 +409,7 @@ signals:
|
||||||
void lockFileError(const QString&);
|
void lockFileError(const QString&);
|
||||||
|
|
||||||
void networkProxySettingChanged();
|
void networkProxySettingChanged();
|
||||||
|
void proxyTypeChanged();
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
void slotCredentialsFetched();
|
void slotCredentialsFetched();
|
||||||
|
@ -481,6 +487,7 @@ private:
|
||||||
QHash<QString, QVector<SyncFileItem::LockStatus>> _lockStatusChangeInprogress;
|
QHash<QString, QVector<SyncFileItem::LockStatus>> _lockStatusChangeInprogress;
|
||||||
|
|
||||||
AccountNetworkProxySetting _networkProxySetting = AccountNetworkProxySetting::GlobalProxy;
|
AccountNetworkProxySetting _networkProxySetting = AccountNetworkProxySetting::GlobalProxy;
|
||||||
|
QNetworkProxy::ProxyType _proxyType = QNetworkProxy::NoProxy;
|
||||||
/* IMPORTANT - remove later - FIXME MS@2019-12-07 -->
|
/* IMPORTANT - remove later - FIXME MS@2019-12-07 -->
|
||||||
* TODO: For "Log out" & "Remove account": Remove client CA certs and KEY!
|
* TODO: For "Log out" & "Remove account": Remove client CA certs and KEY!
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue