Made progress calculation more efficient in torrent content model

Stop to address issue #24.
This commit is contained in:
Christophe Dumez 2012-08-27 22:01:35 +03:00
commit ca2a659970
4 changed files with 16 additions and 18 deletions

View file

@ -69,15 +69,12 @@ void TorrentContentModelFile::setPriority(int new_prio, bool update_parent)
m_priority = new_prio;
// Update parent
if (update_parent) {
m_parentItem->updateProgress();
if (update_parent)
m_parentItem->updatePriority();
}
}
void TorrentContentModelFile::setProgress(qulonglong done)
{
m_totalDone = done;
Q_ASSERT(m_totalDone <= m_size);
m_parentItem->updateProgress();
}