mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-03 03:20:22 +03:00
TorrentContentModel code clean up
This commit is contained in:
parent
38daa23be2
commit
61511201db
2 changed files with 4 additions and 10 deletions
|
@ -124,21 +124,14 @@ void TorrentContentModelFolder::setPriority(int new_prio, bool update_parent)
|
|||
|
||||
m_priority = new_prio;
|
||||
|
||||
// Update parent
|
||||
if (update_parent) {
|
||||
m_parentItem->updateSize();
|
||||
m_parentItem->updateProgress();
|
||||
// Update parent priority
|
||||
if (update_parent)
|
||||
m_parentItem->updatePriority();
|
||||
}
|
||||
|
||||
// Update children
|
||||
if (m_priority != prio::PARTIAL) {
|
||||
qDebug("Updating children items");
|
||||
foreach (TorrentContentModelItem* child, m_childItems) {
|
||||
// Do not update the parent since
|
||||
// the parent is causing the update
|
||||
foreach (TorrentContentModelItem* child, m_childItems)
|
||||
child->setPriority(m_priority, false);
|
||||
}
|
||||
}
|
||||
|
||||
updateSize();
|
||||
|
|
|
@ -60,6 +60,7 @@ void TorrentContentModelItem::setName(const QString& name)
|
|||
qulonglong TorrentContentModelItem::size() const
|
||||
{
|
||||
Q_ASSERT(!isRootItem());
|
||||
|
||||
return m_size;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue