mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
parent
adf7c4ffb6
commit
ca9e5e8531
1 changed files with 10 additions and 2 deletions
|
@ -4033,7 +4033,7 @@ bool Session::addMoveTorrentStorageJob(TorrentImpl *torrent, const QString &newP
|
||||||
|
|
||||||
if (m_moveStorageQueue.size() > 1)
|
if (m_moveStorageQueue.size() > 1)
|
||||||
{
|
{
|
||||||
const auto iter = std::find_if(m_moveStorageQueue.begin() + 1, m_moveStorageQueue.end()
|
auto iter = std::find_if(m_moveStorageQueue.begin() + 1, m_moveStorageQueue.end()
|
||||||
, [&torrentHandle](const MoveStorageJob &job)
|
, [&torrentHandle](const MoveStorageJob &job)
|
||||||
{
|
{
|
||||||
return job.torrentHandle == torrentHandle;
|
return job.torrentHandle == torrentHandle;
|
||||||
|
@ -4042,8 +4042,16 @@ bool Session::addMoveTorrentStorageJob(TorrentImpl *torrent, const QString &newP
|
||||||
if (iter != m_moveStorageQueue.end())
|
if (iter != m_moveStorageQueue.end())
|
||||||
{
|
{
|
||||||
// remove existing inactive job
|
// remove existing inactive job
|
||||||
m_moveStorageQueue.erase(iter);
|
|
||||||
LogMsg(tr("Cancelled moving \"%1\" from \"%2\" to \"%3\".").arg(torrent->name(), currentLocation, iter->path));
|
LogMsg(tr("Cancelled moving \"%1\" from \"%2\" to \"%3\".").arg(torrent->name(), currentLocation, iter->path));
|
||||||
|
iter = m_moveStorageQueue.erase(iter);
|
||||||
|
|
||||||
|
iter = std::find_if(iter, m_moveStorageQueue.end(), [&torrentHandle](const MoveStorageJob &job)
|
||||||
|
{
|
||||||
|
return job.torrentHandle == torrentHandle;
|
||||||
|
});
|
||||||
|
|
||||||
|
const bool torrentHasOutstandingJob = (iter != m_moveStorageQueue.end());
|
||||||
|
torrent->handleMoveStorageJobFinished(torrentHasOutstandingJob);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue