Clean up code

This commit is contained in:
Chocobo1
2018-11-19 12:00:50 +08:00
parent a97543d258
commit 0339e6ee35
3 changed files with 20 additions and 19 deletions

View File

@@ -142,13 +142,14 @@ void TorrentContentModelFolder::recalculateProgress()
qulonglong tSize = 0;
qulonglong tRemaining = 0;
foreach (TorrentContentModelItem *child, m_childItems) {
if (child->priority() != prio::IGNORED) {
if (child->itemType() == FolderType)
static_cast<TorrentContentModelFolder *>(child)->recalculateProgress();
tProgress += child->progress() * child->size();
tSize += child->size();
tRemaining += child->remaining();
}
if (child->priority() == prio::IGNORED)
continue;
if (child->itemType() == FolderType)
static_cast<TorrentContentModelFolder *>(child)->recalculateProgress();
tProgress += child->progress() * child->size();
tSize += child->size();
tRemaining += child->remaining();
}
if (!isRootItem() && (tSize > 0)) {