qBittorrent
|
#include <downloadhandlerimpl.h>
Public Member Functions | |
DownloadHandlerImpl (Net::DownloadManager *manager, const Net::DownloadRequest &downloadRequest) | |
void | cancel () override |
QString | url () const |
const Net::DownloadRequest | downloadRequest () const |
void | assignNetworkReply (QNetworkReply *reply) |
Private Member Functions | |
void | processFinishedDownload () |
void | checkDownloadSize (qint64 bytesReceived, qint64 bytesTotal) |
void | handleRedirection (const QUrl &newUrl) |
void | setError (const QString &error) |
void | finish () |
Static Private Member Functions | |
static QString | errorCodeToString (QNetworkReply::NetworkError status) |
Private Attributes | |
Net::DownloadManager * | m_manager = nullptr |
QNetworkReply * | m_reply = nullptr |
const Net::DownloadRequest | m_downloadRequest |
short | m_redirectionCount = 0 |
Net::DownloadResult | m_result |
Additional Inherited Members | |
Signals inherited from Net::DownloadHandler | |
void | finished (const DownloadResult &result) |
Definition at line 39 of file downloadhandlerimpl.h.
DownloadHandlerImpl::DownloadHandlerImpl | ( | Net::DownloadManager * | manager, |
const Net::DownloadRequest & | downloadRequest | ||
) |
Definition at line 56 of file downloadhandlerimpl.cpp.
References m_result, Net::DownloadResult::status, Net::Success, url(), and Net::DownloadResult::url.
void DownloadHandlerImpl::assignNetworkReply | ( | QNetworkReply * | reply | ) |
Definition at line 78 of file downloadhandlerimpl.cpp.
References checkDownloadSize(), Net::DownloadRequest::limit(), m_downloadRequest, m_reply, and processFinishedDownload().
|
overridevirtual |
Implements Net::DownloadHandler.
Definition at line 65 of file downloadhandlerimpl.cpp.
References errorCodeToString(), finish(), m_reply, and setError().
|
private |
Definition at line 152 of file downloadhandlerimpl.cpp.
References finish(), Utils::Misc::friendlyUnit(), Net::DownloadRequest::limit(), m_downloadRequest, m_reply, and setError().
Referenced by assignNetworkReply().
const Net::DownloadRequest DownloadHandlerImpl::downloadRequest | ( | ) | const |
Definition at line 96 of file downloadhandlerimpl.cpp.
References m_downloadRequest.
|
staticprivate |
Definition at line 219 of file downloadhandlerimpl.cpp.
Referenced by cancel(), and processFinishedDownload().
|
private |
Definition at line 214 of file downloadhandlerimpl.cpp.
References Net::DownloadHandler::finished(), and m_result.
Referenced by cancel(), checkDownloadSize(), handleRedirection(), and processFinishedDownload().
|
private |
Definition at line 171 of file downloadhandlerimpl.cpp.
References Net::DownloadManager::download(), Net::DownloadResult::errorString, finish(), Net::DownloadHandler::finished(), m_downloadRequest, m_manager, m_redirectionCount, m_reply, m_result, Net::DownloadResult::magnet, MAX_REDIRECTIONS, Net::RedirectedToMagnet, setError(), Net::DownloadResult::status, url(), and Net::DownloadResult::url.
Referenced by processFinishedDownload().
|
private |
Definition at line 101 of file downloadhandlerimpl.cpp.
References Net::DownloadResult::data, Utils::Gzip::decompress(), Net::DownloadRequest::destFileName(), errorCodeToString(), Net::DownloadResult::filePath, finish(), handleRedirection(), m_downloadRequest, m_reply, m_result, Net::DownloadRequest::saveToFile(), Utils::IO::saveToFile(), anonymous_namespace{downloadhandlerimpl.cpp}::saveToTempFile(), setError(), and url().
Referenced by assignNetworkReply().
|
private |
Definition at line 208 of file downloadhandlerimpl.cpp.
References Net::DownloadResult::errorString, Net::Failed, m_result, and Net::DownloadResult::status.
Referenced by cancel(), checkDownloadSize(), handleRedirection(), and processFinishedDownload().
QString DownloadHandlerImpl::url | ( | ) | const |
Definition at line 91 of file downloadhandlerimpl.cpp.
References m_downloadRequest, and Net::DownloadRequest::url().
Referenced by DownloadHandlerImpl(), handleRedirection(), and processFinishedDownload().
|
private |
Definition at line 65 of file downloadhandlerimpl.h.
Referenced by assignNetworkReply(), checkDownloadSize(), downloadRequest(), handleRedirection(), processFinishedDownload(), and url().
|
private |
Definition at line 63 of file downloadhandlerimpl.h.
Referenced by handleRedirection().
|
private |
Definition at line 66 of file downloadhandlerimpl.h.
Referenced by handleRedirection().
|
private |
Definition at line 64 of file downloadhandlerimpl.h.
Referenced by assignNetworkReply(), cancel(), checkDownloadSize(), handleRedirection(), and processFinishedDownload().
|
private |
Definition at line 67 of file downloadhandlerimpl.h.
Referenced by DownloadHandlerImpl(), finish(), handleRedirection(), processFinishedDownload(), and setError().