mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -06: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:
@@ -147,10 +147,19 @@ void TorrentContentModelFolder::recalculateProgress()
|
||||
tRemaining += child->remaining();
|
||||
}
|
||||
|
||||
if (!isRootItem() && (tSize > 0))
|
||||
if (!isRootItem())
|
||||
{
|
||||
if (tSize > 0)
|
||||
{
|
||||
m_progress = tProgress / tSize;
|
||||
m_remaining = tRemaining;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_progress = 1.0;
|
||||
m_remaining = 0;
|
||||
}
|
||||
|
||||
Q_ASSERT(m_progress <= 1.);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user