mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-21 08:09:35 +08:00
Merge pull request #14025 from glassez/fix-move
Fix bug of "move storage job" can be performed multiple times
This commit is contained in:
commit
4029f86c60
@ -4065,6 +4065,8 @@ void Session::moveTorrentStorage(const MoveStorageJob &job) const
|
||||
void Session::handleMoveTorrentStorageJobFinished()
|
||||
{
|
||||
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()
|
||||
, [&finishedJob](const MoveStorageJob &job)
|
||||
@ -4076,11 +4078,10 @@ void Session::handleMoveTorrentStorageJobFinished()
|
||||
|
||||
TorrentHandleImpl *torrent = m_torrents.value(finishedJob.torrentHandle.info_hash());
|
||||
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
|
||||
const lt::torrent_handle nativeHandle {finishedJob.torrentHandle};
|
||||
@ -4090,10 +4091,6 @@ void Session::handleMoveTorrentStorageJobFinished()
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_moveStorageQueue.isEmpty())
|
||||
moveTorrentStorage(m_moveStorageQueue.first());
|
||||
}
|
||||
|
||||
void Session::handleTorrentTrackerWarning(TorrentHandleImpl *const torrent, const QString &trackerUrl)
|
||||
{
|
||||
emit trackerWarning(torrent, trackerUrl);
|
||||
|
Loading…
Reference in New Issue
Block a user