mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Use DownloadHandler behind the scenes
This commit is contained in:
parent
6cb15706f5
commit
746916a963
17 changed files with 325 additions and 409 deletions
|
@ -67,7 +67,6 @@
|
|||
#include "base/exceptions.h"
|
||||
#include "base/global.h"
|
||||
#include "base/logger.h"
|
||||
#include "base/net/downloadhandler.h"
|
||||
#include "base/net/downloadmanager.h"
|
||||
#include "base/net/portforwarder.h"
|
||||
#include "base/net/proxyconfigurationmanager.h"
|
||||
|
@ -1794,10 +1793,9 @@ bool Session::addTorrent(const QString &source, const AddTorrentParams ¶ms)
|
|||
if (Net::DownloadManager::hasSupportedScheme(source)) {
|
||||
LogMsg(tr("Downloading '%1', please wait...", "e.g: Downloading 'xxx.torrent', please wait...").arg(source));
|
||||
// Launch downloader
|
||||
const Net::DownloadHandler *handler =
|
||||
Net::DownloadManager::instance()->download(Net::DownloadRequest(source).limit(10485760 /* 10MB */));
|
||||
connect(handler, &Net::DownloadHandler::finished, this, &Session::handleDownloadFinished);
|
||||
m_downloadedTorrents[handler->url()] = params;
|
||||
Net::DownloadManager::instance()->download(Net::DownloadRequest(source).limit(10485760 /* 10MB */)
|
||||
, this, &Session::handleDownloadFinished);
|
||||
m_downloadedTorrents[source] = params;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue