mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03:00
Show download progress for folders with zero byte size as 100 instead of 0
Fixes the download progress calculation for folders with zero size. Previously, the progress would be Zero. Now, folders with zero size show 100% progress. PR #20567.
This commit is contained in:
parent
7a2bfae5e4
commit
9317c25ecb
1 changed files with 12 additions and 3 deletions
|
@ -147,10 +147,19 @@ void TorrentContentModelFolder::recalculateProgress()
|
||||||
tRemaining += child->remaining();
|
tRemaining += child->remaining();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isRootItem() && (tSize > 0))
|
if (!isRootItem())
|
||||||
|
{
|
||||||
|
if (tSize > 0)
|
||||||
{
|
{
|
||||||
m_progress = tProgress / tSize;
|
m_progress = tProgress / tSize;
|
||||||
m_remaining = tRemaining;
|
m_remaining = tRemaining;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_progress = 1.0;
|
||||||
|
m_remaining = 0;
|
||||||
|
}
|
||||||
|
|
||||||
Q_ASSERT(m_progress <= 1.);
|
Q_ASSERT(m_progress <= 1.);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue