qBittorrent
|
#include <torrentimpl.h>
Public Member Functions | |
TorrentImpl (Session *session, lt::session *nativeSession, const lt::torrent_handle &nativeHandle, const LoadTorrentParams ¶ms) | |
~TorrentImpl () override | |
bool | isValid () const |
InfoHash | infoHash () const override |
QString | name () const override |
QDateTime | creationDate () const override |
QString | creator () const override |
QString | comment () const override |
bool | isPrivate () const override |
qlonglong | totalSize () const override |
qlonglong | wantedSize () const override |
qlonglong | completedSize () const override |
qlonglong | pieceLength () const override |
qlonglong | wastedSize () const override |
QString | currentTracker () const override |
bool | isAutoTMMEnabled () const override |
void | setAutoTMMEnabled (bool enabled) override |
QString | savePath () const override |
void | setSavePath (const QString &path) override |
QString | downloadPath () const override |
void | setDownloadPath (const QString &path) override |
QString | actualStorageLocation () const override |
QString | rootPath () const override |
QString | contentPath () const override |
QString | category () const override |
bool | belongsToCategory (const QString &category) const override |
bool | setCategory (const QString &category) override |
TagSet | tags () const override |
bool | hasTag (const QString &tag) const override |
bool | addTag (const QString &tag) override |
bool | removeTag (const QString &tag) override |
void | removeAllTags () override |
int | filesCount () const override |
int | piecesCount () const override |
int | piecesHave () const override |
qreal | progress () const override |
QDateTime | addedTime () const override |
qreal | ratioLimit () const override |
int | seedingTimeLimit () const override |
QString | filePath (int index) const override |
QString | actualFilePath (int index) const override |
qlonglong | fileSize (int index) const override |
QStringList | filePaths () const override |
QVector< DownloadPriority > | filePriorities () const override |
TorrentInfo | info () const override |
bool | isSeed () const override |
bool | isPaused () const override |
bool | isQueued () const override |
bool | isForced () const override |
bool | isChecking () const override |
bool | isDownloading () const override |
bool | isUploading () const override |
bool | isCompleted () const override |
bool | isActive () const override |
bool | isInactive () const override |
bool | isErrored () const override |
bool | isSequentialDownload () const override |
bool | hasFirstLastPiecePriority () const override |
TorrentState | state () const override |
bool | hasMetadata () const override |
bool | hasMissingFiles () const override |
bool | hasError () const override |
int | queuePosition () const override |
QVector< TrackerEntry > | trackers () const override |
QVector< QUrl > | urlSeeds () const override |
QString | error () const override |
qlonglong | totalDownload () const override |
qlonglong | totalUpload () const override |
qlonglong | activeTime () const override |
qlonglong | finishedTime () const override |
qlonglong | eta () const override |
QVector< qreal > | filesProgress () const override |
int | seedsCount () const override |
int | peersCount () const override |
int | leechsCount () const override |
int | totalSeedsCount () const override |
int | totalPeersCount () const override |
int | totalLeechersCount () const override |
int | completeCount () const override |
int | incompleteCount () const override |
QDateTime | lastSeenComplete () const override |
QDateTime | completedTime () const override |
qlonglong | timeSinceUpload () const override |
qlonglong | timeSinceDownload () const override |
qlonglong | timeSinceActivity () const override |
int | downloadLimit () const override |
int | uploadLimit () const override |
bool | superSeeding () const override |
bool | isDHTDisabled () const override |
bool | isPEXDisabled () const override |
bool | isLSDDisabled () const override |
QVector< PeerInfo > | peers () const override |
QBitArray | pieces () const override |
QBitArray | downloadingPieces () const override |
QVector< int > | pieceAvailability () const override |
qreal | distributedCopies () const override |
qreal | maxRatio () const override |
int | maxSeedingTime () const override |
qreal | realRatio () const override |
int | uploadPayloadRate () const override |
int | downloadPayloadRate () const override |
qlonglong | totalPayloadUpload () const override |
qlonglong | totalPayloadDownload () const override |
int | connectionsCount () const override |
int | connectionsLimit () const override |
qlonglong | nextAnnounce () const override |
QVector< qreal > | availableFileFractions () const override |
fraction of file pieces that are available at least from one peer More... | |
void | setName (const QString &name) override |
void | setSequentialDownload (bool enable) override |
void | setFirstLastPiecePriority (bool enabled) override |
void | pause () override |
void | resume (TorrentOperatingMode mode=TorrentOperatingMode::AutoManaged) override |
void | forceReannounce (int index=-1) override |
void | forceDHTAnnounce () override |
void | forceRecheck () override |
void | renameFile (int index, const QString &path) override |
void | prioritizeFiles (const QVector< DownloadPriority > &priorities) override |
void | setRatioLimit (qreal limit) override |
void | setSeedingTimeLimit (int limit) override |
void | setUploadLimit (int limit) override |
void | setDownloadLimit (int limit) override |
void | setSuperSeeding (bool enable) override |
void | setDHTDisabled (bool disable) override |
void | setPEXDisabled (bool disable) override |
void | setLSDDisabled (bool disable) override |
void | flushCache () const override |
void | addTrackers (const QVector< TrackerEntry > &trackers) override |
void | replaceTrackers (const QVector< TrackerEntry > &trackers) override |
void | addUrlSeeds (const QVector< QUrl > &urlSeeds) override |
void | removeUrlSeeds (const QVector< QUrl > &urlSeeds) override |
bool | connectPeer (const PeerAddress &peerAddress) override |
void | clearPeers () override |
QString | createMagnetURI () const override |
bool | needSaveResumeData () const |
lt::torrent_handle | nativeHandle () const |
void | handleAlert (const lt::alert *a) |
void | handleStateUpdate (const lt::torrent_status &nativeStatus) |
void | handleDownloadPathChanged () |
void | handleCategoryOptionsChanged () |
void | handleAppendExtensionToggled () |
void | saveResumeData () |
void | handleMoveStorageJobFinished (bool hasOutstandingJob) |
void | fileSearchFinished (const QString &savePath, const QStringList &fileNames) |
![]() | |
virtual | ~Torrent ()=default |
TorrentID | id () const |
bool | isResumed () const |
qlonglong | remainingSize () const |
void | toggleSequentialDownload () |
void | toggleFirstLastPiecePriority () |
![]() | |
virtual | ~AbstractFileStorage ()=default |
void | renameFile (const QString &oldPath, const QString &newPath) |
void | renameFolder (const QString &oldPath, const QString &newPath) |
Private Types | |
using | EventTrigger = std::function< void()> |
Private Member Functions | |
void | updateStatus () |
void | updateStatus (const lt::torrent_status &nativeStatus) |
void | updateState () |
void | handleFastResumeRejectedAlert (const lt::fastresume_rejected_alert *p) |
void | handleFileCompletedAlert (const lt::file_completed_alert *p) |
void | handleFileErrorAlert (const lt::file_error_alert *p) |
void | handleFileRenamedAlert (const lt::file_renamed_alert *p) |
void | handleFileRenameFailedAlert (const lt::file_rename_failed_alert *p) |
void | handleMetadataReceivedAlert (const lt::metadata_received_alert *p) |
void | handlePerformanceAlert (const lt::performance_alert *p) const |
void | handleSaveResumeDataAlert (const lt::save_resume_data_alert *p) |
void | handleSaveResumeDataFailedAlert (const lt::save_resume_data_failed_alert *p) |
void | handleTorrentCheckedAlert (const lt::torrent_checked_alert *p) |
void | handleTorrentFinishedAlert (const lt::torrent_finished_alert *p) |
void | handleTorrentPausedAlert (const lt::torrent_paused_alert *p) |
void | handleTorrentResumedAlert (const lt::torrent_resumed_alert *p) |
void | handleTrackerErrorAlert (const lt::tracker_error_alert *p) |
void | handleTrackerReplyAlert (const lt::tracker_reply_alert *p) |
void | handleTrackerWarningAlert (const lt::tracker_warning_alert *p) |
bool | isMoveInProgress () const |
void | setAutoManaged (bool enable) |
void | adjustStorageLocation () |
void | moveStorage (const QString &newPath, MoveStorageMode mode) |
void | manageIncompleteFiles () |
void | applyFirstLastPiecePriority (bool enabled, const QVector< DownloadPriority > &updatedFilePrio={}) |
void | prepareResumeData (const lt::add_torrent_params ¶ms) |
void | endReceivedMetadataHandling (const QString &savePath, const QStringList &fileNames) |
void | reload () |
Private Attributes | |
Session *const | m_session |
lt::session * | m_nativeSession |
lt::torrent_handle | m_nativeHandle |
lt::torrent_status | m_nativeStatus |
TorrentState | m_state = TorrentState::Unknown |
TorrentInfo | m_torrentInfo |
QStringList | m_filePaths |
SpeedMonitor | m_speedMonitor |
InfoHash | m_infoHash |
QQueue< EventTrigger > | m_moveFinishedTriggers |
int | m_renameCount = 0 |
bool | m_storageIsMoving = false |
MaintenanceJob | m_maintenanceJob = MaintenanceJob::None |
QHash< QString, QMap< lt::tcp::endpoint, int > > | m_trackerPeerCounts |
FileErrorInfo | m_lastFileError |
QString | m_name |
QString | m_savePath |
QString | m_downloadPath |
QString | m_category |
TagSet | m_tags |
qreal | m_ratioLimit |
int | m_seedingTimeLimit |
TorrentOperatingMode | m_operatingMode |
TorrentContentLayout | m_contentLayout |
bool | m_hasSeedStatus |
bool | m_fastresumeDataRejected = false |
bool | m_hasMissingFiles = false |
bool | m_hasFirstLastPiecePriority = false |
bool | m_useAutoTMM |
bool | m_isStopped |
bool | m_unchecked = false |
lt::add_torrent_params | m_ltAddTorrentParams |
Additional Inherited Members | |
![]() | |
static const qreal | USE_GLOBAL_RATIO = -2 |
static const qreal | NO_RATIO_LIMIT = -1 |
static const int | USE_GLOBAL_SEEDING_TIME = -2 |
static const int | NO_SEEDING_TIME_LIMIT = -1 |
static const qreal | MAX_RATIO = 9999 |
static const int | MAX_SEEDING_TIME = 525600 |
Definition at line 77 of file torrentimpl.h.
|
private |
Definition at line 242 of file torrentimpl.h.
TorrentImpl::TorrentImpl | ( | Session * | session, |
lt::session * | nativeSession, | ||
const lt::torrent_handle & | nativeHandle, | ||
const LoadTorrentParams & | params | ||
) |
Definition at line 242 of file torrentimpl.cpp.
References actualStorageLocation(), applyFirstLastPiecePriority(), Utils::Fs::branchPath(), Utils::Fs::fileName(), filePath(), BitTorrent::TorrentInfo::filesCount(), filesCount(), hasMetadata(), anonymous_namespace{torrentimpl.cpp}::initializeStatus(), m_filePaths, m_hasFirstLastPiecePriority, m_ltAddTorrentParams, m_nativeHandle, m_nativeStatus, m_torrentInfo, BitTorrent::TorrentInfo::nativeIndexes(), QB_EXT, renameFile(), Utils::Fs::toUniformPath(), and updateState().
|
override |
Definition at line 318 of file torrentimpl.cpp.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1050 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 801 of file torrentimpl.cpp.
References m_nativeHandle, m_torrentInfo, and BitTorrent::TorrentInfo::nativeIndexes().
Referenced by handleFileCompletedAlert(), and manageIncompleteFiles().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 488 of file torrentimpl.cpp.
References m_nativeStatus, and Utils::Fs::toUniformPath().
Referenced by BitTorrent::Session::addMoveTorrentStorageJob(), contentPath(), BitTorrent::Session::handleTorrentFinished(), rootPath(), and TorrentImpl().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 781 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 746 of file torrentimpl.cpp.
References BitTorrent::Session::addTag(), BitTorrent::Session::handleTorrentNeedSaveResumeData(), BitTorrent::Session::handleTorrentTagAdded(), BitTorrent::Session::hasTag(), hasTag(), BitTorrent::Session::isValidTag(), m_session, and m_tags.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 521 of file torrentimpl.cpp.
References BitTorrent::Session::handleTorrentNeedSaveResumeData(), BitTorrent::Session::handleTorrentTrackersAdded(), m_nativeHandle, m_session, anonymous_namespace{torrentimpl.cpp}::makeNativeAnnouncerEntry(), and trackers().
Referenced by BitTorrent::Session::addTorrent_impl().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 601 of file torrentimpl.cpp.
References BitTorrent::Session::handleTorrentNeedSaveResumeData(), BitTorrent::Session::handleTorrentUrlSeedsAdded(), m_nativeHandle, m_session, and urlSeeds().
Referenced by BitTorrent::Session::addTorrent_impl().
|
private |
Definition at line 2071 of file torrentimpl.cpp.
References downloadPath(), isSeed(), m_hasSeedStatus, moveStorage(), BitTorrent::Overwrite, and savePath().
Referenced by handleCategoryOptionsChanged(), handleDownloadPathChanged(), handleTorrentCheckedAlert(), handleTorrentFinishedAlert(), setAutoTMMEnabled(), and setCategory().
|
private |
Definition at line 1447 of file torrentimpl.cpp.
References BitTorrent::TorrentInfo::filePieces(), filePriorities(), fileSize(), IndexRange< Index, IndexDiff >::first(), hasMetadata(), BitTorrent::Ignored, IndexRange< Index, IndexDiff >::last(), m_nativeHandle, m_torrentInfo, BitTorrent::Maximum, nativeHandle(), and pieceLength().
Referenced by endReceivedMetadataHandling(), prioritizeFiles(), setFirstLastPiecePriority(), and TorrentImpl().
|
overridevirtual |
fraction of file pieces that are available at least from one peer
This is not the same as torrrent availability, it is just a fraction of pieces that can be downloaded right now. It varies between 0 to 1.
Implements BitTorrent::Torrent.
Definition at line 2259 of file torrentimpl.cpp.
References BitTorrent::TorrentInfo::filePieces(), filesCount(), hasMetadata(), IndexRange< Index, IndexDiff >::isEmpty(), m_torrentInfo, pieceAvailability(), and IndexRange< Index, IndexDiff >::size().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 723 of file torrentimpl.cpp.
References category(), BitTorrent::Session::isSubcategoriesEnabled(), BitTorrent::Session::isValidCategoryName(), m_category, and m_session.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 718 of file torrentimpl.cpp.
References m_category.
Referenced by belongsToCategory(), downloadPath(), savePath(), setAutoTMMEnabled(), and setCategory().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 649 of file torrentimpl.cpp.
References m_nativeHandle.
Referenced by replaceTrackers().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 355 of file torrentimpl.cpp.
References BitTorrent::TorrentInfo::comment(), and m_torrentInfo.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1157 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 376 of file torrentimpl.cpp.
References m_nativeStatus.
Referenced by eta().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1177 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1341 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1346 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 654 of file torrentimpl.cpp.
References BitTorrent::PeerAddress::ip, LogMsg(), m_nativeHandle, name(), BitTorrent::PeerAddress::port, BitTorrent::PeerAddress::toString(), and Log::WARNING.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 453 of file torrentimpl.cpp.
References actualStorageLocation(), filePath(), filesCount(), hasMetadata(), and rootPath().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 2219 of file torrentimpl.cpp.
References m_nativeHandle.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 345 of file torrentimpl.cpp.
References BitTorrent::TorrentInfo::creationDate(), and m_torrentInfo.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 350 of file torrentimpl.cpp.
References BitTorrent::TorrentInfo::creator(), and m_torrentInfo.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 391 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1284 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1263 of file torrentimpl.cpp.
References info(), m_nativeHandle, piecesCount(), and BitTorrent::LT::toUnderlyingType().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1208 of file torrentimpl.cpp.
References m_nativeHandle.
Referenced by setDownloadLimit().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 418 of file torrentimpl.cpp.
References category(), BitTorrent::Session::categoryDownloadPath(), isAutoTMMEnabled(), m_downloadPath, and m_session.
Referenced by adjustStorageLocation(), and handleSaveResumeDataAlert().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1326 of file torrentimpl.cpp.
References m_nativeStatus.
|
private |
Definition at line 1487 of file torrentimpl.cpp.
References applyFirstLastPiecePriority(), filePath(), BitTorrent::Session::handleTorrentMetadataReceived(), m_filePaths, m_hasFirstLastPiecePriority, m_ltAddTorrentParams, m_maintenanceJob, m_nativeHandle, m_session, m_torrentInfo, BitTorrent::TorrentInfo::nativeIndexes(), BitTorrent::None, BitTorrent::Normal, prepareResumeData(), QB_EXT, reload(), savePath(), BitTorrent::LT::toNative(), Utils::Fs::toNativePath(), and updateStatus().
Referenced by fileSearchFinished().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1023 of file torrentimpl.cpp.
References BitTorrent::FileErrorInfo::error, m_lastFileError, and m_nativeStatus.
Referenced by nova3.sgmllib3.SGMLParser::goahead(), nova3.sgmllib3.SGMLParser::parse_pi(), and nova3.sgmllib3.SGMLParser::parse_starttag().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1060 of file torrentimpl.cpp.
References SpeedMonitor::average(), completedSize(), Sample< T >::download, finishedTime(), isPaused(), isSeed(), m_speedMonitor, MAX_ETA, maxRatio(), maxSeedingTime(), totalDownload(), totalUpload(), Sample< T >::upload, and wantedSize().
|
overridevirtual |
Implements BitTorrent::AbstractFileStorage.
Definition at line 796 of file torrentimpl.cpp.
References m_filePaths.
Referenced by contentPath(), endReceivedMetadataHandling(), handleFileCompletedAlert(), handleFileRenameFailedAlert(), manageIncompleteFiles(), and TorrentImpl().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 812 of file torrentimpl.cpp.
References m_filePaths.
Referenced by handleSaveResumeDataAlert(), BitTorrent::Session::handleTorrentFinished(), and BitTorrent::Session::recursiveTorrentDownload().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 817 of file torrentimpl.cpp.
References asConst(), filesCount(), BitTorrent::LT::fromNative(), hasMetadata(), m_nativeHandle, m_torrentInfo, BitTorrent::TorrentInfo::nativeIndexes(), and BitTorrent::LT::toUnderlyingType().
Referenced by applyFirstLastPiecePriority(), and prioritizeFiles().
|
overridevirtual |
Implements BitTorrent::AbstractFileStorage.
Definition at line 687 of file torrentimpl.cpp.
References BitTorrent::TorrentInfo::filesCount(), and m_torrentInfo.
Referenced by availableFileFractions(), contentPath(), filePriorities(), filesProgress(), manageIncompleteFiles(), prioritizeFiles(), and TorrentImpl().
void TorrentImpl::fileSearchFinished | ( | const QString & | savePath, |
const QStringList & | fileNames | ||
) |
Definition at line 1482 of file torrentimpl.cpp.
References endReceivedMetadataHandling(), and savePath().
Referenced by BitTorrent::Session::fileSearchFinished().
|
overridevirtual |
Implements BitTorrent::AbstractFileStorage.
Definition at line 807 of file torrentimpl.cpp.
References BitTorrent::TorrentInfo::fileSize(), and m_torrentInfo.
Referenced by applyFirstLastPiecePriority(), filesProgress(), and manageIncompleteFiles().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1101 of file torrentimpl.cpp.
References filesCount(), fileSize(), hasMetadata(), m_nativeHandle, m_torrentInfo, BitTorrent::TorrentInfo::nativeIndexes(), progress(), and BitTorrent::LT::toUnderlyingType().
Referenced by manageIncompleteFiles(), and prioritizeFiles().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1055 of file torrentimpl.cpp.
References m_nativeStatus.
Referenced by eta().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 2214 of file torrentimpl.cpp.
References m_nativeHandle.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1395 of file torrentimpl.cpp.
References m_nativeHandle.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1390 of file torrentimpl.cpp.
References m_nativeHandle.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1400 of file torrentimpl.cpp.
References hasMetadata(), isPaused(), m_hasMissingFiles, m_nativeHandle, and m_unchecked.
Referenced by handleTorrentFinishedAlert().
void TorrentImpl::handleAlert | ( | const lt::alert * | a | ) |
Definition at line 1977 of file torrentimpl.cpp.
References handleFastResumeRejectedAlert(), handleFileCompletedAlert(), handleFileErrorAlert(), handleFileRenamedAlert(), handleFileRenameFailedAlert(), handleMetadataReceivedAlert(), handlePerformanceAlert(), handleSaveResumeDataAlert(), handleSaveResumeDataFailedAlert(), handleTorrentCheckedAlert(), handleTorrentFinishedAlert(), handleTorrentPausedAlert(), handleTorrentResumedAlert(), handleTrackerErrorAlert(), handleTrackerReplyAlert(), and handleTrackerWarningAlert().
Referenced by BitTorrent::Session::dispatchTorrentAlert(), and BitTorrent::Session::handleFileErrorAlert().
void TorrentImpl::handleAppendExtensionToggled | ( | ) |
Definition at line 1970 of file torrentimpl.cpp.
References hasMetadata(), and manageIncompleteFiles().
void TorrentImpl::handleCategoryOptionsChanged | ( | ) |
Definition at line 1964 of file torrentimpl.cpp.
References adjustStorageLocation(), and m_useAutoTMM.
void TorrentImpl::handleDownloadPathChanged | ( | ) |
Definition at line 1629 of file torrentimpl.cpp.
References adjustStorageLocation().
|
private |
Definition at line 1837 of file torrentimpl.cpp.
References Log::CRITICAL, LogMsg(), m_fastresumeDataRejected, m_hasMissingFiles, name(), and Log::WARNING.
Referenced by handleAlert().
|
private |
Definition at line 1918 of file torrentimpl.cpp.
References actualFilePath(), filePath(), BitTorrent::Session::isAppendExtensionEnabled(), m_session, m_torrentInfo, name(), BitTorrent::TorrentInfo::nativeIndexes(), and renameFile().
Referenced by handleAlert().
|
private |
Definition at line 1936 of file torrentimpl.cpp.
References BitTorrent::FileErrorInfo::error, and m_lastFileError.
Referenced by handleAlert().
|
private |
Definition at line 1854 of file torrentimpl.cpp.
References BitTorrent::Session::handleTorrentNeedSaveResumeData(), isMoveInProgress(), Utils::String::join(), m_filePaths, m_moveFinishedTriggers, m_renameCount, m_session, m_torrentInfo, BitTorrent::TorrentInfo::nativeIndexes(), QB_EXT, savePath(), and Utils::Fs::toUniformPath().
Referenced by handleAlert().
|
private |
Definition at line 1903 of file torrentimpl.cpp.
References filePath(), BitTorrent::Session::handleTorrentNeedSaveResumeData(), isMoveInProgress(), LogMsg(), m_moveFinishedTriggers, m_renameCount, m_session, m_torrentInfo, name(), BitTorrent::TorrentInfo::nativeIndexes(), and Log::WARNING.
Referenced by handleAlert().
|
private |
Definition at line 1949 of file torrentimpl.cpp.
References BitTorrent::HandleMetadata, BitTorrent::Session::handleTorrentNeedSaveResumeData(), m_maintenanceJob, m_session, and name().
Referenced by handleAlert().
void TorrentImpl::handleMoveStorageJobFinished | ( | bool | hasOutstandingJob | ) |
Definition at line 1634 of file torrentimpl.cpp.
References BitTorrent::Session::handleTorrentNeedSaveResumeData(), BitTorrent::Session::handleTorrentSavePathChanged(), m_hasMissingFiles, m_ltAddTorrentParams, m_moveFinishedTriggers, m_nativeHandle, m_nativeStatus, m_renameCount, m_session, m_storageIsMoving, reload(), and updateStatus().
Referenced by BitTorrent::Session::handleMoveTorrentStorageJobFinished().
|
private |
Definition at line 1958 of file torrentimpl.cpp.
References Log::INFO, and LogMsg().
Referenced by handleAlert().
|
private |
Definition at line 1765 of file torrentimpl.cpp.
References BitTorrent::applyContentLayout(), downloadPath(), BitTorrent::TorrentInfo::filePaths(), filePaths(), BitTorrent::Session::findIncompleteFiles(), BitTorrent::HandleMetadata, m_contentLayout, m_ltAddTorrentParams, m_maintenanceJob, m_nativeHandle, m_session, prepareResumeData(), and savePath().
Referenced by handleAlert().
|
private |
Definition at line 1831 of file torrentimpl.cpp.
Referenced by handleAlert().
void TorrentImpl::handleStateUpdate | ( | const lt::torrent_status & | nativeStatus | ) |
Definition at line 1624 of file torrentimpl.cpp.
References updateStatus().
Referenced by BitTorrent::Session::handleStateUpdateAlert().
|
private |
Definition at line 1689 of file torrentimpl.cpp.
References adjustStorageLocation(), BitTorrent::Session::handleTorrentChecked(), BitTorrent::Session::handleTorrentNeedSaveResumeData(), hasMetadata(), m_fastresumeDataRejected, m_hasMissingFiles, m_hasSeedStatus, m_nativeHandle, m_session, manageIncompleteFiles(), name(), progress(), updateStatus(), and wantedSize().
Referenced by handleAlert().
|
private |
Definition at line 1724 of file torrentimpl.cpp.
References adjustStorageLocation(), forceRecheck(), BitTorrent::Session::handleTorrentFinished(), BitTorrent::Session::handleTorrentNeedSaveResumeData(), Preferences::instance(), isMoveInProgress(), m_hasMissingFiles, m_hasSeedStatus, m_moveFinishedTriggers, m_renameCount, m_session, m_unchecked, manageIncompleteFiles(), name(), Preferences::recheckTorrentsOnCompletion(), and updateStatus().
Referenced by handleAlert().
|
private |
Definition at line 1755 of file torrentimpl.cpp.
Referenced by handleAlert().
|
private |
Definition at line 1760 of file torrentimpl.cpp.
Referenced by handleAlert().
|
private |
Definition at line 1673 of file torrentimpl.cpp.
References BitTorrent::Session::handleTorrentTrackerError(), m_session, BitTorrent::TrackerEntry::NotWorking, and trackers().
Referenced by handleAlert().
|
private |
Definition at line 1659 of file torrentimpl.cpp.
References BitTorrent::Session::handleTorrentTrackerReply(), m_session, and m_trackerPeerCounts.
Referenced by handleAlert().
|
private |
Definition at line 1667 of file torrentimpl.cpp.
References BitTorrent::Session::handleTorrentTrackerWarning(), and m_session.
Referenced by handleAlert().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1013 of file torrentimpl.cpp.
References m_nativeStatus.
Referenced by resume(), and updateState().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 931 of file torrentimpl.cpp.
References m_hasFirstLastPiecePriority.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1003 of file torrentimpl.cpp.
References BitTorrent::TorrentInfo::isValid(), and m_torrentInfo.
Referenced by applyFirstLastPiecePriority(), availableFileFractions(), contentPath(), filePriorities(), filesProgress(), forceRecheck(), handleAppendExtensionToggled(), handleTorrentCheckedAlert(), name(), prioritizeFiles(), rootPath(), setFirstLastPiecePriority(), TorrentImpl(), updateState(), and updateStatus().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1008 of file torrentimpl.cpp.
References m_hasMissingFiles.
Referenced by updateState().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 741 of file torrentimpl.cpp.
References OrderedSet< T, Compare >::contains(), and m_tags.
Referenced by addTag().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1163 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 835 of file torrentimpl.cpp.
References m_torrentInfo.
Referenced by downloadingPieces().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 325 of file torrentimpl.cpp.
References m_infoHash.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 890 of file torrentimpl.cpp.
References BitTorrent::Downloading, BitTorrent::DownloadingMetadata, BitTorrent::ForcedDownloading, BitTorrent::ForcedDownloadingMetadata, BitTorrent::ForcedUploading, m_state, BitTorrent::Moving, BitTorrent::StalledDownloading, BitTorrent::Uploading, and uploadPayloadRate().
Referenced by isInactive().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 465 of file torrentimpl.cpp.
References m_useAutoTMM.
Referenced by downloadPath(), savePath(), setDownloadPath(), and setSavePath().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 853 of file torrentimpl.cpp.
References m_nativeStatus.
Referenced by progress(), and updateStatus().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 880 of file torrentimpl.cpp.
References BitTorrent::CheckingUploading, BitTorrent::ForcedUploading, m_state, BitTorrent::PausedUploading, BitTorrent::QueuedUploading, BitTorrent::StalledUploading, and BitTorrent::Uploading.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1223 of file torrentimpl.cpp.
References m_nativeStatus.
Referenced by setDHTDisabled().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 859 of file torrentimpl.cpp.
References BitTorrent::CheckingDownloading, BitTorrent::Downloading, BitTorrent::DownloadingMetadata, BitTorrent::ForcedDownloading, BitTorrent::ForcedDownloadingMetadata, m_state, BitTorrent::PausedDownloading, BitTorrent::QueuedDownloading, and BitTorrent::StalledDownloading.
Referenced by updateStatus().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 909 of file torrentimpl.cpp.
References BitTorrent::Error, m_state, and BitTorrent::MissingFiles.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 921 of file torrentimpl.cpp.
References isPaused(), and m_operatingMode.
Referenced by updateState().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 904 of file torrentimpl.cpp.
References isActive().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1233 of file torrentimpl.cpp.
References m_nativeStatus.
Referenced by setLSDDisabled().
|
private |
Definition at line 2085 of file torrentimpl.cpp.
References m_storageIsMoving.
Referenced by handleFileRenamedAlert(), handleFileRenameFailedAlert(), handleTorrentFinishedAlert(), and updateState().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 840 of file torrentimpl.cpp.
References m_isStopped.
Referenced by eta(), forceRecheck(), isForced(), isQueued(), and updateState().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1228 of file torrentimpl.cpp.
References m_nativeStatus.
Referenced by setPEXDisabled().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 360 of file torrentimpl.cpp.
References BitTorrent::TorrentInfo::isPrivate(), and m_torrentInfo.
Referenced by BitTorrent::Session::addTorrent_impl(), and replaceTrackers().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 845 of file torrentimpl.cpp.
References isPaused(), and m_nativeStatus.
Referenced by updateState().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 915 of file torrentimpl.cpp.
References m_nativeStatus.
Referenced by adjustStorageLocation(), eta(), setDownloadPath(), setSavePath(), and updateState().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 926 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 871 of file torrentimpl.cpp.
References BitTorrent::CheckingUploading, BitTorrent::ForcedUploading, m_state, BitTorrent::QueuedUploading, BitTorrent::StalledUploading, and BitTorrent::Uploading.
bool TorrentImpl::isValid | ( | ) | const |
Definition at line 320 of file torrentimpl.cpp.
References m_nativeHandle.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1169 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1136 of file torrentimpl.cpp.
References m_nativeStatus.
|
private |
Definition at line 2037 of file torrentimpl.cpp.
References actualFilePath(), filePath(), filesCount(), fileSize(), filesProgress(), BitTorrent::Session::isAppendExtensionEnabled(), m_session, QB_EXT, and renameFile().
Referenced by handleAppendExtensionToggled(), handleTorrentCheckedAlert(), and handleTorrentFinishedAlert().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1289 of file torrentimpl.cpp.
References BitTorrent::Session::globalMaxRatio(), m_ratioLimit, m_session, and BitTorrent::Torrent::USE_GLOBAL_RATIO.
Referenced by eta().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1297 of file torrentimpl.cpp.
References BitTorrent::Session::globalMaxSeedingMinutes(), m_seedingTimeLimit, m_session, and BitTorrent::Torrent::USE_GLOBAL_SEEDING_TIME.
Referenced by eta().
|
private |
Definition at line 1609 of file torrentimpl.cpp.
References BitTorrent::Session::addMoveTorrentStorageJob(), m_session, m_storageIsMoving, Utils::Fs::toNativePath(), and updateStatus().
Referenced by adjustStorageLocation(), setDownloadPath(), and setSavePath().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 330 of file torrentimpl.cpp.
References hasMetadata(), BitTorrent::Torrent::id(), m_name, m_nativeStatus, m_torrentInfo, BitTorrent::TorrentInfo::name(), and Digest32< N >::toString().
Referenced by BitTorrent::Session::addMoveTorrentStorageJob(), connectPeer(), BitTorrent::Session::deleteTorrent(), handleFastResumeRejectedAlert(), handleFileCompletedAlert(), BitTorrent::Session::handleFileErrorAlert(), handleFileRenameFailedAlert(), handleMetadataReceivedAlert(), BitTorrent::Session::handleStorageMovedAlert(), BitTorrent::Session::handleStorageMovedFailedAlert(), handleTorrentCheckedAlert(), BitTorrent::Session::handleTorrentFinished(), handleTorrentFinishedAlert(), BitTorrent::Session::handleTorrentMetadataReceived(), BitTorrent::Session::handleTorrentSaveResumeDataRequested(), BitTorrent::Session::handleTorrentTrackersAdded(), BitTorrent::Session::handleTorrentTrackersRemoved(), BitTorrent::Session::handleTorrentUrlSeedsAdded(), BitTorrent::Session::handleTorrentUrlSeedsRemoved(), BitTorrent::Session::handleUrlSeedAlert(), BitTorrent::Session::moveTorrentStorage(), BitTorrent::Session::recursiveTorrentDownload(), setFirstLastPiecePriority(), and setName().
lt::torrent_handle TorrentImpl::nativeHandle | ( | ) | const |
Definition at line 2080 of file torrentimpl.cpp.
References m_nativeHandle.
Referenced by BitTorrent::Session::addMoveTorrentStorageJob(), applyFirstLastPiecePriority(), BitTorrent::Session::bottomTorrentsQueuePos(), BitTorrent::Session::decreaseTorrentsQueuePos(), BitTorrent::Session::deleteTorrent(), BitTorrent::Session::handleTorrentFinished(), BitTorrent::Session::handleTorrentMetadataReceived(), BitTorrent::Session::increaseTorrentsQueuePos(), and BitTorrent::Session::topTorrentsQueuePos().
bool TorrentImpl::needSaveResumeData | ( | ) | const |
Definition at line 676 of file torrentimpl.cpp.
References m_nativeHandle.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1351 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1552 of file torrentimpl.cpp.
References BitTorrent::Session::handleTorrentNeedSaveResumeData(), BitTorrent::Session::handleTorrentPaused(), m_isStopped, m_maintenanceJob, m_nativeHandle, m_session, m_speedMonitor, BitTorrent::None, SpeedMonitor::reset(), and setAutoManaged().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1238 of file torrentimpl.cpp.
References m_nativeHandle.
Referenced by totalPeersCount().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1131 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1276 of file torrentimpl.cpp.
References m_nativeHandle.
Referenced by availableFileFractions().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 381 of file torrentimpl.cpp.
References m_torrentInfo, and BitTorrent::TorrentInfo::pieceLength().
Referenced by applyFirstLastPiecePriority().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1252 of file torrentimpl.cpp.
References m_nativeStatus.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 692 of file torrentimpl.cpp.
References m_torrentInfo, and BitTorrent::TorrentInfo::piecesCount().
Referenced by downloadingPieces().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 697 of file torrentimpl.cpp.
References m_nativeStatus.
|
private |
Definition at line 1786 of file torrentimpl.cpp.
References BitTorrent::LoadTorrentParams::category, BitTorrent::LoadTorrentParams::contentLayout, BitTorrent::LoadTorrentParams::downloadPath, BitTorrent::LoadTorrentParams::firstLastPiecePriority, BitTorrent::Session::handleTorrentResumeDataReady(), BitTorrent::LoadTorrentParams::hasSeedStatus, BitTorrent::LoadTorrentParams::ltAddTorrentParams, m_category, m_contentLayout, m_downloadPath, m_hasFirstLastPiecePriority, m_hasMissingFiles, m_hasSeedStatus, m_isStopped, m_ltAddTorrentParams, m_name, m_operatingMode, m_ratioLimit, m_savePath, m_seedingTimeLimit, m_session, m_tags, m_useAutoTMM, BitTorrent::LoadTorrentParams::name, BitTorrent::LoadTorrentParams::operatingMode, BitTorrent::LoadTorrentParams::ratioLimit, BitTorrent::LoadTorrentParams::savePath, BitTorrent::LoadTorrentParams::seedingTimeLimit, BitTorrent::LoadTorrentParams::stopped, BitTorrent::LoadTorrentParams::tags, and BitTorrent::LoadTorrentParams::useAutoTMM.
Referenced by endReceivedMetadataHandling(), and handleSaveResumeDataAlert().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 2224 of file torrentimpl.cpp.
References applyFirstLastPiecePriority(), filePriorities(), filesCount(), filesProgress(), hasMetadata(), BitTorrent::Ignored, m_hasFirstLastPiecePriority, m_hasSeedStatus, m_nativeHandle, m_torrentInfo, BitTorrent::TorrentInfo::nativeIndexes(), BitTorrent::TorrentInfo::nativeInfo(), BitTorrent::Normal, progress(), BitTorrent::LT::toNative(), and BitTorrent::LT::toUnderlyingType().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 702 of file torrentimpl.cpp.
References isChecking(), and m_nativeStatus.
Referenced by filesProgress(), handleTorrentCheckedAlert(), and prioritizeFiles().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1018 of file torrentimpl.cpp.
References m_nativeStatus.
Referenced by BitTorrent::Session::bottomTorrentsQueuePos(), BitTorrent::Session::decreaseTorrentsQueuePos(), BitTorrent::Session::increaseTorrentsQueuePos(), and BitTorrent::Session::topTorrentsQueuePos().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 786 of file torrentimpl.cpp.
References m_ratioLimit.
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1305 of file torrentimpl.cpp.
References m_nativeStatus, and BitTorrent::Torrent::MAX_RATIO.
|
private |
Definition at line 1523 of file torrentimpl.cpp.
References m_isStopped, m_ltAddTorrentParams, m_nativeHandle, m_nativeSession, and m_operatingMode.
Referenced by endReceivedMetadataHandling(), handleMoveStorageJobFinished(), and resume().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 775 of file torrentimpl.cpp.
References asConst(), removeTag(), and tags().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 764 of file torrentimpl.cpp.
References BitTorrent::Session::handleTorrentNeedSaveResumeData(), BitTorrent::Session::handleTorrentTagRemoved(), m_session, m_tags, and OrderedSet< T, Compare >::remove().
Referenced by removeAllTags().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 625 of file torrentimpl.cpp.
References BitTorrent::Session::handleTorrentNeedSaveResumeData(), BitTorrent::Session::handleTorrentUrlSeedsRemoved(), m_nativeHandle, m_session, and urlSeeds().
|
overridevirtual |
Implements BitTorrent::AbstractFileStorage.
Definition at line 1618 of file torrentimpl.cpp.
References m_nativeHandle, m_renameCount, m_torrentInfo, BitTorrent::TorrentInfo::nativeIndexes(), and Utils::Fs::toNativePath().
Referenced by handleFileCompletedAlert(), manageIncompleteFiles(), and TorrentImpl().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 546 of file torrentimpl.cpp.
References clearPeers(), BitTorrent::Session::handleTorrentNeedSaveResumeData(), BitTorrent::Session::handleTorrentTrackersAdded(), BitTorrent::Session::handleTorrentTrackersChanged(), BitTorrent::Session::handleTorrentTrackersRemoved(), isPrivate(), m_nativeHandle, m_session, anonymous_namespace{torrentimpl.cpp}::makeNativeAnnouncerEntry(), and trackers().
|
overridevirtual |
Implements BitTorrent::Torrent.
Definition at line 1570 of file torrentimpl.cpp.
References BitTorrent::Session::handleTorrentNeedSaveResumeData(), BitTorrent::Session::handleTorrentResumed(), hasError(), m_hasMissingFiles, m_isStopped, m_ltAddTorrentParams, m_maintenanceJob, m_nativeHandle, m_operatingMode, m_session, BitTorrent::None, reload(), setAutoManaged(), and updateStatus().