From 8c6a181ee38215303ec29831e0d5336e8577eb21 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Fri, 28 Jun 2024 17:54:06 +0800 Subject: [PATCH] Add proxy port property to account Signed-off-by: Claudio Cambra --- src/libsync/account.cpp | 15 +++++++++++++++ src/libsync/account.h | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index d559b158a..1d3030971 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -1133,4 +1133,19 @@ void Account::setProxyHostName(const QString &hostName) emit proxyHostNameChanged(); } +int Account::proxyPort() const +{ + return _proxyPort; +} + +void Account::setProxyPort(const int port) +{ + if (_proxyPort == port) { + return; + } + + _proxyPort = port; + emit proxyPortChanged(); +} + } // namespace OCC diff --git a/src/libsync/account.h b/src/libsync/account.h index f50f04537..867771840 100644 --- a/src/libsync/account.h +++ b/src/libsync/account.h @@ -94,6 +94,7 @@ class OWNCLOUDSYNC_EXPORT Account : public QObject Q_PROPERTY(AccountNetworkProxySetting networkProxySetting READ networkProxySetting WRITE setNetworkProxySetting NOTIFY networkProxySettingChanged) Q_PROPERTY(QNetworkProxy::ProxyType proxyType READ proxyType WRITE setProxyType NOTIFY proxyTypeChanged) Q_PROPERTY(QString proxyHostName READ proxyHostName WRITE setProxyHostName NOTIFY proxyHostNameChanged) + Q_PROPERTY(int proxyPort READ proxyPort WRITE setProxyPort NOTIFY proxyPortChanged) public: enum class AccountNetworkProxySetting { @@ -368,6 +369,9 @@ public: [[nodiscard]] QString proxyHostName() const; void setProxyHostName(const QString &host); + [[nodiscard]] int proxyPort() const; + void setProxyPort(int port); + public slots: /// Used when forgetting credentials void clearQNAMCache(); @@ -415,6 +419,7 @@ signals: void networkProxySettingChanged(); void proxyTypeChanged(); void proxyHostNameChanged(); + void proxyPortChanged(); protected Q_SLOTS: void slotCredentialsFetched(); @@ -494,6 +499,7 @@ private: AccountNetworkProxySetting _networkProxySetting = AccountNetworkProxySetting::GlobalProxy; QNetworkProxy::ProxyType _proxyType = QNetworkProxy::NoProxy; QString _proxyHostName; + int _proxyPort = 0; /* IMPORTANT - remove later - FIXME MS@2019-12-07 --> * TODO: For "Log out" & "Remove account": Remove client CA certs and KEY! *