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 } // namespace OCC

View file

@ -90,6 +90,7 @@ class OWNCLOUDSYNC_EXPORT Account : public QObject
Q_PROPERTY(QUrl url MEMBER _url) Q_PROPERTY(QUrl url MEMBER _url)
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)
public: public:
enum class AccountNetworkProxySetting { enum class AccountNetworkProxySetting {
@ -354,6 +355,10 @@ public:
void updateServerSubcription(); void updateServerSubcription();
void updateDesktopEnterpriseChannel(); void updateDesktopEnterpriseChannel();
// Network-related settings
[[nodiscard]] AccountNetworkProxySetting networkProxySetting() const;
void setNetworkProxySetting(AccountNetworkProxySetting networkProxySetting);
public slots: public slots:
/// Used when forgetting credentials /// Used when forgetting credentials
void clearQNAMCache(); void clearQNAMCache();
@ -398,6 +403,8 @@ signals:
void lockFileSuccess(); void lockFileSuccess();
void lockFileError(const QString&); void lockFileError(const QString&);
void networkProxySettingChanged();
protected Q_SLOTS: protected Q_SLOTS:
void slotCredentialsFetched(); void slotCredentialsFetched();
void slotCredentialsAsked(); void slotCredentialsAsked();
@ -473,6 +480,7 @@ private:
QHash<QString, QVector<SyncFileItem::LockStatus>> _lockStatusChangeInprogress; QHash<QString, QVector<SyncFileItem::LockStatus>> _lockStatusChangeInprogress;
AccountNetworkProxySetting _networkProxySetting = AccountNetworkProxySetting::GlobalProxy;
/* 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!
* *