|
|
@ -1,6 +1,6 @@ |
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Bittorrent Client using Qt and libtorrent. |
|
|
|
* Bittorrent Client using Qt and libtorrent. |
|
|
|
* Copyright (C) 2015 Vladimir Golovnev <glassez@yandex.ru> |
|
|
|
* Copyright (C) 2015-2022 Vladimir Golovnev <glassez@yandex.ru> |
|
|
|
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org> |
|
|
|
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org> |
|
|
|
* |
|
|
|
* |
|
|
|
* This program is free software; you can redistribute it and/or |
|
|
|
* This program is free software; you can redistribute it and/or |
|
|
@ -1695,8 +1695,6 @@ void TorrentImpl::handleMoveStorageJobFinished(const bool hasOutstandingJob) |
|
|
|
void TorrentImpl::handleTorrentCheckedAlert(const lt::torrent_checked_alert *p) |
|
|
|
void TorrentImpl::handleTorrentCheckedAlert(const lt::torrent_checked_alert *p) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_UNUSED(p); |
|
|
|
Q_UNUSED(p); |
|
|
|
qDebug("\"%s\" have just finished checking.", qUtf8Printable(name())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!hasMetadata()) |
|
|
|
if (!hasMetadata()) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1705,14 +1703,16 @@ void TorrentImpl::handleTorrentCheckedAlert(const lt::torrent_checked_alert *p) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (m_nativeHandle.need_save_resume_data()) |
|
|
|
m_statusUpdatedTriggers.enqueue([this]() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
qDebug("\"%s\" have just finished checking.", qUtf8Printable(name())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_nativeStatus.need_save_resume) |
|
|
|
m_session->handleTorrentNeedSaveResumeData(this); |
|
|
|
m_session->handleTorrentNeedSaveResumeData(this); |
|
|
|
|
|
|
|
|
|
|
|
if (m_fastresumeDataRejected && !m_hasMissingFiles) |
|
|
|
if (m_fastresumeDataRejected && !m_hasMissingFiles) |
|
|
|
m_fastresumeDataRejected = false; |
|
|
|
m_fastresumeDataRejected = false; |
|
|
|
|
|
|
|
|
|
|
|
updateStatus(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!m_hasMissingFiles) |
|
|
|
if (!m_hasMissingFiles) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if ((progress() < 1.0) && (wantedSize() > 0)) |
|
|
|
if ((progress() < 1.0) && (wantedSize() > 0)) |
|
|
@ -1725,6 +1725,7 @@ void TorrentImpl::handleTorrentCheckedAlert(const lt::torrent_checked_alert *p) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
m_session->handleTorrentChecked(this); |
|
|
|
m_session->handleTorrentChecked(this); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TorrentImpl::handleTorrentFinishedAlert(const lt::torrent_finished_alert *p) |
|
|
|
void TorrentImpl::handleTorrentFinishedAlert(const lt::torrent_finished_alert *p) |
|
|
@ -1735,7 +1736,8 @@ void TorrentImpl::handleTorrentFinishedAlert(const lt::torrent_finished_alert *p |
|
|
|
m_hasMissingFiles = false; |
|
|
|
m_hasMissingFiles = false; |
|
|
|
if (m_hasSeedStatus) return; |
|
|
|
if (m_hasSeedStatus) return; |
|
|
|
|
|
|
|
|
|
|
|
updateStatus(); |
|
|
|
m_statusUpdatedTriggers.enqueue([this]() |
|
|
|
|
|
|
|
{ |
|
|
|
m_hasSeedStatus = true; |
|
|
|
m_hasSeedStatus = true; |
|
|
|
|
|
|
|
|
|
|
|
adjustStorageLocation(); |
|
|
|
adjustStorageLocation(); |
|
|
@ -1747,8 +1749,8 @@ void TorrentImpl::handleTorrentFinishedAlert(const lt::torrent_finished_alert *p |
|
|
|
if (isMoveInProgress() || (m_renameCount > 0)) |
|
|
|
if (isMoveInProgress() || (m_renameCount > 0)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (recheckTorrentsOnCompletion) |
|
|
|
if (recheckTorrentsOnCompletion) |
|
|
|
m_moveFinishedTriggers.append([this]() { forceRecheck(); }); |
|
|
|
m_moveFinishedTriggers.enqueue([this]() { forceRecheck(); }); |
|
|
|
m_moveFinishedTriggers.append([this]() { m_session->handleTorrentFinished(this); }); |
|
|
|
m_moveFinishedTriggers.enqueue([this]() { m_session->handleTorrentFinished(this); }); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1756,6 +1758,7 @@ void TorrentImpl::handleTorrentFinishedAlert(const lt::torrent_finished_alert *p |
|
|
|
forceRecheck(); |
|
|
|
forceRecheck(); |
|
|
|
m_session->handleTorrentFinished(this); |
|
|
|
m_session->handleTorrentFinished(this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TorrentImpl::handleTorrentPausedAlert(const lt::torrent_paused_alert *p) |
|
|
|
void TorrentImpl::handleTorrentPausedAlert(const lt::torrent_paused_alert *p) |
|
|
@ -2124,6 +2127,9 @@ void TorrentImpl::updateStatus(const lt::torrent_status &nativeStatus) |
|
|
|
else if (isDownloading()) |
|
|
|
else if (isDownloading()) |
|
|
|
m_unchecked = true; |
|
|
|
m_unchecked = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (!m_statusUpdatedTriggers.isEmpty()) |
|
|
|
|
|
|
|
std::invoke(m_statusUpdatedTriggers.dequeue()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TorrentImpl::setRatioLimit(qreal limit) |
|
|
|
void TorrentImpl::setRatioLimit(qreal limit) |
|
|
|