Add network proxy setting property to account

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-06-28 17:51:11 +08:00
parent 15bc9a4892
commit 2501cdf44d
No known key found for this signature in database
GPG key ID: C839200C384636B0
2 changed files with 22 additions and 0 deletions

View file

@ -1088,5 +1088,19 @@ void Account::updateDesktopEnterpriseChannel()
}
}
Account::AccountNetworkProxySetting Account::networkProxySetting() const
{
return _networkProxySetting;
}
void Account::setNetworkProxySetting(const AccountNetworkProxySetting setting)
{
if (setting == _networkProxySetting) {
return;
}
_networkProxySetting = setting;
emit networkProxySettingChanged();
}
} // namespace OCC

View file

@ -90,6 +90,7 @@ class OWNCLOUDSYNC_EXPORT Account : public QObject
Q_PROPERTY(QUrl url MEMBER _url)
Q_PROPERTY(bool e2eEncryptionKeysGenerationAllowed MEMBER _e2eEncryptionKeysGenerationAllowed)
Q_PROPERTY(bool askUserForMnemonic READ askUserForMnemonic WRITE setAskUserForMnemonic NOTIFY askUserForMnemonicChanged)
Q_PROPERTY(AccountNetworkProxySetting networkProxySetting READ networkProxySetting WRITE setNetworkProxySetting NOTIFY networkProxySettingChanged)
public:
enum class AccountNetworkProxySetting {
@ -354,6 +355,10 @@ public:
void updateServerSubcription();
void updateDesktopEnterpriseChannel();
// Network-related settings
[[nodiscard]] AccountNetworkProxySetting networkProxySetting() const;
void setNetworkProxySetting(AccountNetworkProxySetting networkProxySetting);
public slots:
/// Used when forgetting credentials
void clearQNAMCache();
@ -398,6 +403,8 @@ signals:
void lockFileSuccess();
void lockFileError(const QString&);
void networkProxySettingChanged();
protected Q_SLOTS:
void slotCredentialsFetched();
void slotCredentialsAsked();
@ -473,6 +480,7 @@ private:
QHash<QString, QVector<SyncFileItem::LockStatus>> _lockStatusChangeInprogress;
AccountNetworkProxySetting _networkProxySetting = AccountNetworkProxySetting::GlobalProxy;
/* IMPORTANT - remove later - FIXME MS@2019-12-07 -->
* TODO: For "Log out" & "Remove account": Remove client CA certs and KEY!
*