When generally setting dirty proxy in folderman only mark dirty those that follow general client proxy settings

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-06-28 19:43:48 +08:00
parent ac9819797c
commit 8e9e125dee
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -1511,13 +1511,14 @@ void FolderMan::setDirtyProxy()
{
const auto folderMapValues = _folderMap.values();
for (const auto folder : folderMapValues) {
if (folder) {
if (folder->accountState() && folder->accountState()->account()
&& folder->accountState()->account()->networkAccessManager()) {
if (folder
&& folder->accountState()
&& folder->accountState()->account()
&& folder->accountState()->account()->networkAccessManager()
&& folder->accountState()->account()->networkProxySetting() == Account::AccountNetworkProxySetting::GlobalProxy) {
// Need to do this so we do not use the old determined system proxy
folder->accountState()->account()->networkAccessManager()->setProxy(
QNetworkProxy(QNetworkProxy::DefaultProxy));
}
const auto proxy = QNetworkProxy(QNetworkProxy::DefaultProxy);
folder->accountState()->account()->networkAccessManager()->setProxy(proxy);
}
}
}