Allow to use proxy per subsystem

This commit is contained in:
Vladimir Golovnev (Glassez)
2023-01-28 20:40:38 +03:00
parent 4745a40f0b
commit 6ac14d0c57
23 changed files with 357 additions and 339 deletions

View File

@@ -45,6 +45,7 @@
#include "base/global.h"
#include "base/logger.h"
#include "base/net/downloadmanager.h"
#include "base/preferences.h"
#include "base/profile.h"
#include "base/utils/fs.h"
#include "feed_serializer.h"
@@ -148,7 +149,7 @@ void Feed::refresh()
// NOTE: Should we allow manually refreshing for disabled session?
m_downloadHandler = Net::DownloadManager::instance()->download(m_url, true);
m_downloadHandler = Net::DownloadManager::instance()->download(m_url, Preferences::instance()->useProxyForRSS());
connect(m_downloadHandler, &Net::DownloadHandler::finished, this, &Feed::handleDownloadFinished);
if (!m_iconPath.exists())
@@ -378,7 +379,7 @@ void Feed::downloadIcon()
const auto iconUrl = u"%1://%2/favicon.ico"_qs.arg(url.scheme(), url.host());
Net::DownloadManager::instance()->download(
Net::DownloadRequest(iconUrl).saveToFile(true).destFileName(m_iconPath)
, true, this, &Feed::handleIconDownloadFinished);
, Preferences::instance()->useProxyForRSS(), this, &Feed::handleIconDownloadFinished);
}
int Feed::updateArticles(const QList<QVariantHash> &loadedArticles)