Improve DownloadManager.

Now we can use downloaded data directly without saving to file.
We also can disable redirection to Magnet URI handling (useful for
non-torrent files downloading).
This commit is contained in:
Vladimir Golovnev (Glassez) 2015-06-03 11:49:39 +03:00
parent 336519b7b5
commit c702a7e426
11 changed files with 45 additions and 27 deletions

View file

@ -1049,7 +1049,7 @@ bool Session::addTorrent(QString source, const AddTorrentParams &params)
if (Utils::Misc::isUrl(source)) {
Logger::instance()->addMessage(tr("Downloading '%1', please wait...", "e.g: Downloading 'xxx.torrent', please wait...").arg(source));
// Launch downloader
Net::DownloadHandler *handler = Net::DownloadManager::instance()->downloadUrl(source, 10485760 /* 10MB */);
Net::DownloadHandler *handler = Net::DownloadManager::instance()->downloadUrl(source, true, 10485760 /* 10MB */, true);
connect(handler, SIGNAL(downloadFinished(QString, QString)), this, SLOT(handleDownloadFinished(QString, QString)));
connect(handler, SIGNAL(downloadFailed(QString, QString)), this, SLOT(handleDownloadFailed(QString, QString)));
connect(handler, SIGNAL(redirectedToMagnet(QString, QString)), this, SLOT(handleRedirectedToMagnet(QString, QString)));