Merge pull request #19291 from Chocobo1/limits

Expose 'bdecode limits' settings
This commit is contained in:
Chocobo1
2023-07-11 11:24:09 +08:00
committed by GitHub
13 changed files with 152 additions and 24 deletions

View File

@@ -43,7 +43,6 @@
#include <QUrl>
#include <QVector>
#include "base/bittorrent/common.h"
#include "base/bittorrent/downloadpriority.h"
#include "base/bittorrent/infohash.h"
#include "base/bittorrent/magneturi.h"
@@ -489,10 +488,11 @@ void AddNewTorrentDialog::show(const QString &source, const BitTorrent::AddTorre
if (Net::DownloadManager::hasSupportedScheme(source))
{
const auto *pref = Preferences::instance();
// Launch downloader
Net::DownloadManager::instance()->download(
Net::DownloadRequest(source).limit(MAX_TORRENT_SIZE)
, Preferences::instance()->useProxyForGeneralPurposes()
Net::DownloadRequest(source).limit(pref->getTorrentFileSizeLimit())
, pref->useProxyForGeneralPurposes()
, dlg, &AddNewTorrentDialog::handleDownloadFinished);
return;
}