20 #ifndef BTCHUNKMANAGER_H
21 #define BTCHUNKMANAGER_H
28 #include <util/bitset.h>
29 #include <torrent/torrent.h>
30 #include <ktorrent_export.h>
39 class PreallocationThread;
40 class TorrentFileInterface;
47 unsigned int deprecated;
65 const QString& tmpdir,
66 const QString& datadir,
67 bool custom_output_name,
83 void changeOutputPath(
const QString& output_path);
236 return excluded_chunks;
244 return only_seed_chunks;
352 static Uint32 preview_size_audio;
353 static Uint32 preview_size_video;
void dndMissingFiles()
Set missing files as do not download.
Simple implementation of a BitSet.
Uint32 getNumChunks() const
Get the number of chunks.
Uint64 diskUsage()
Get the current disk usage of all the files in this torrent.
Uint32 onlySeedChunks() const
bool completed() const
Are all not deselected chunks downloaded.
void exclude(Uint32 from, Uint32 to)
void include(Uint32 from, Uint32 to)
Uint32 chunksDownloaded() const
Keep track of a piece of the file.
void preparePreallocation(PreallocationThread *prealloc)
void markExistingFilesAsDownloaded()
Mark all existing files as downloaded.
bool hasExistingFiles() const
Test if the torrent has existing files, only works the first time a torrent is loaded.
void dataChecked(const BitSet &ok_chunks, Uint32 from, Uint32 to)
void prioritise(Uint32 from, Uint32 to, Priority priority)
void changeDataDir(const QString &data_dir)
Uint64 bytesLeftToDownload() const
void createFiles(bool check_priority=false)
Uint32 getNumChunks() const
Get the number of chunks into the file.
Uint32 previewChunkRangeSize(const TorrentFile &tf) const
Get the size in chunks of the preview range of a file of the torrent.
void debugPrintMemUsage()
Print memory usage to log file.
Uint32 previewChunkRangeSize() const
Get the size in chunks of the preview range for a single file torrent.
void excluded(Uint32 from, Uint32 to)
void downloadPriorityChanged(TorrentFile *tf, Priority newpriority, Priority oldpriority)
The download priority of a file has changed.
void moveDataFilesFinished(const QMap< TorrentFileInterface *, QString > &files, Job *job)
Chunk * getChunk(unsigned int i)
void corrupted(Uint32 chunk)
Uint32 chunksExcluded() const
bool hasMissingFiles(QStringList &sl)
bool isStorageMounted(QStringList &missing)
Is the storage mounted ?
Job * deleteDataFiles()
Delete all data files.
void chunkDownloaded(unsigned int i)
Job * moveDataFiles(const QString &ndir)
QString getOutputPath() const
Get the actual output path.
const BitSet & getBitSet() const
const BitSet & getOnlySeedBitSet() const
const Torrent & getTorrent() const
Get the torrent.
void included(Uint32 from, Uint32 to)
Uint32 chunksLeft() const
Job * moveDataFiles(const QMap< TorrentFileInterface *, QString > &files)
Uint64 bytesExcluded() const
const BitSet & getExcludedBitSet() const
bool haveAllChunks() const
void resetChunk(unsigned int i)
static void setPreviewSizes(Uint32 audio, Uint32 video)
Set the preview sizes for audio and video files.
void recreateMissingFiles()
Recreates missing files.
void moveDataFilesFinished(Job *job)
void checkMemoryUsage()
Remove obsolete chunks.
QString getDataDir() const
Get the data dir.