|
|
@ -4065,6 +4065,8 @@ void Session::moveTorrentStorage(const MoveStorageJob &job) const |
|
|
|
void Session::handleMoveTorrentStorageJobFinished() |
|
|
|
void Session::handleMoveTorrentStorageJobFinished() |
|
|
|
{ |
|
|
|
{ |
|
|
|
const MoveStorageJob finishedJob = m_moveStorageQueue.takeFirst(); |
|
|
|
const MoveStorageJob finishedJob = m_moveStorageQueue.takeFirst(); |
|
|
|
|
|
|
|
if (!m_moveStorageQueue.isEmpty()) |
|
|
|
|
|
|
|
moveTorrentStorage(m_moveStorageQueue.first()); |
|
|
|
|
|
|
|
|
|
|
|
const auto iter = std::find_if(m_moveStorageQueue.cbegin(), m_moveStorageQueue.cend() |
|
|
|
const auto iter = std::find_if(m_moveStorageQueue.cbegin(), m_moveStorageQueue.cend() |
|
|
|
, [&finishedJob](const MoveStorageJob &job) |
|
|
|
, [&finishedJob](const MoveStorageJob &job) |
|
|
@ -4076,11 +4078,10 @@ void Session::handleMoveTorrentStorageJobFinished() |
|
|
|
|
|
|
|
|
|
|
|
TorrentHandleImpl *torrent = m_torrents.value(finishedJob.torrentHandle.info_hash()); |
|
|
|
TorrentHandleImpl *torrent = m_torrents.value(finishedJob.torrentHandle.info_hash()); |
|
|
|
if (torrent) |
|
|
|
if (torrent) |
|
|
|
torrent->handleMoveStorageJobFinished(torrentHasOutstandingJob); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!torrentHasOutstandingJob) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!torrent) |
|
|
|
torrent->handleMoveStorageJobFinished(torrentHasOutstandingJob); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (!torrentHasOutstandingJob) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Last job is completed for torrent that being removing, so actually remove it
|
|
|
|
// Last job is completed for torrent that being removing, so actually remove it
|
|
|
|
const lt::torrent_handle nativeHandle {finishedJob.torrentHandle}; |
|
|
|
const lt::torrent_handle nativeHandle {finishedJob.torrentHandle}; |
|
|
@ -4088,10 +4089,6 @@ void Session::handleMoveTorrentStorageJobFinished() |
|
|
|
if (removingTorrentData.deleteOption == Torrent) |
|
|
|
if (removingTorrentData.deleteOption == Torrent) |
|
|
|
m_nativeSession->remove_torrent(nativeHandle, lt::session::delete_partfile); |
|
|
|
m_nativeSession->remove_torrent(nativeHandle, lt::session::delete_partfile); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!m_moveStorageQueue.isEmpty()) |
|
|
|
|
|
|
|
moveTorrentStorage(m_moveStorageQueue.first()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Session::handleTorrentTrackerWarning(TorrentHandleImpl *const torrent, const QString &trackerUrl) |
|
|
|
void Session::handleTorrentTrackerWarning(TorrentHandleImpl *const torrent, const QString &trackerUrl) |
|
|
|