Manages the downloading.
More...
#include <downloader.h>
|
static void | setUseWebSeeds (bool on) |
| Enable or disable the use of webseeds.
|
|
- Author
- Joris Guisson This class manages the downloading of the file. It should regurarly be updated.
Definition at line 67 of file downloader.h.
◆ Downloader()
◆ addPieceDownloader()
We got a new connection.
- Parameters
-
◆ canDownloadFromWebSeed()
bool bt::Downloader::canDownloadFromWebSeed |
( |
Uint32 |
chunk | ) |
const |
Can we download a chunk from a webseed.
- Parameters
-
- Returns
- true if we can
◆ chunkDownloaded
void bt::Downloader::chunkDownloaded |
( |
Uint32 |
chunk | ) |
|
|
signal |
Emitted when a chunk has been downloaded.
- Parameters
-
◆ clearDownloads()
void bt::Downloader::clearDownloads |
( |
| ) |
|
Clear all downloads. Deletes all active downloads.
◆ corrupted()
void bt::Downloader::corrupted |
( |
Uint32 |
chunk | ) |
|
A corrupted chunk has been detected, make sure we redownload it.
- Parameters
-
◆ dataChecked
void bt::Downloader::dataChecked |
( |
const BitSet & |
ok_chunks, |
|
|
bt::Uint32 |
from, |
|
|
bt::Uint32 |
to |
|
) |
| |
|
slot |
Data has been checked, and these chunks are OK.
- Parameters
-
ok_chunks | The ok_chunks |
from | First chunk of the check |
to | Last chunk of the check |
◆ download() [1/2]
Get a download for a chunk
- Parameters
-
- Returns
- The ChunkDownload, or 0 if no download is found
◆ download() [2/2]
const ChunkDownload* bt::Downloader::download |
( |
Uint32 |
chunk | ) |
const |
Get a download for a chunk (const version)
- Parameters
-
- Returns
- The ChunkDownload, or 0 if no download is found
◆ downloading()
bool bt::Downloader::downloading |
( |
Uint32 |
chunk | ) |
const |
See if we are downloading a Chunk
- Parameters
-
- Returns
- true if we are, false if not
◆ getDownloadedBytesOfCurrentChunksFile()
Uint32 bt::Downloader::getDownloadedBytesOfCurrentChunksFile |
( |
const QString & |
file | ) |
|
Get the number of bytes already downloaded in the current_chunks file.
- Parameters
-
file | The path of the current_chunks file |
- Returns
- The bytes already downloading
◆ ioError
void bt::Downloader::ioError |
( |
const QString & |
msg | ) |
|
|
signal |
An error occurred while we we're writing or reading from disk.
- Parameters
-
◆ loadDownloads()
void bt::Downloader::loadDownloads |
( |
const QString & |
file | ) |
|
Load the current downloads.
- Parameters
-
file | The file to load from |
◆ numDownloadersForChunk()
Uint32 bt::Downloader::numDownloadersForChunk |
( |
Uint32 |
chunk | ) |
const |
Get the number of downloaders assigned to a chunk
- Parameters
-
- Returns
- the number of downloaders for that chunk
◆ pause()
void bt::Downloader::pause |
( |
| ) |
|
◆ recalcDownloaded
void bt::Downloader::recalcDownloaded |
( |
| ) |
|
|
slot |
Recalculate the number of bytes downloaded.
◆ removePieceDownloader()
Remove a piece downloader.
- Parameters
-
◆ saveDownloads()
void bt::Downloader::saveDownloads |
( |
const QString & |
file | ) |
|
Save the current downloads.
- Parameters
-
◆ setGroupIDs()
void bt::Downloader::setGroupIDs |
( |
Uint32 |
up, |
|
|
Uint32 |
down |
|
) |
| |
Set the group ID's of the webseed (for speed limits)
- Parameters
-
up | Upload group id |
down | Download group id |
◆ setMonitor
Set the TorrentMonitor.
- Parameters
-
◆ update
void bt::Downloader::update |
( |
| ) |
|
|
slot |
The documentation for this class was generated from the following file: