mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 14:57:52 +00:00
TorrentContentModel code clean up
This commit is contained in:
parent
38daa23be2
commit
61511201db
@ -124,21 +124,14 @@ void TorrentContentModelFolder::setPriority(int new_prio, bool update_parent)
|
|||||||
|
|
||||||
m_priority = new_prio;
|
m_priority = new_prio;
|
||||||
|
|
||||||
// Update parent
|
// Update parent priority
|
||||||
if (update_parent) {
|
if (update_parent)
|
||||||
m_parentItem->updateSize();
|
|
||||||
m_parentItem->updateProgress();
|
|
||||||
m_parentItem->updatePriority();
|
m_parentItem->updatePriority();
|
||||||
}
|
|
||||||
|
|
||||||
// Update children
|
// Update children
|
||||||
if (m_priority != prio::PARTIAL) {
|
if (m_priority != prio::PARTIAL) {
|
||||||
qDebug("Updating children items");
|
foreach (TorrentContentModelItem* child, m_childItems)
|
||||||
foreach (TorrentContentModelItem* child, m_childItems) {
|
|
||||||
// Do not update the parent since
|
|
||||||
// the parent is causing the update
|
|
||||||
child->setPriority(m_priority, false);
|
child->setPriority(m_priority, false);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSize();
|
updateSize();
|
||||||
|
@ -60,6 +60,7 @@ void TorrentContentModelItem::setName(const QString& name)
|
|||||||
qulonglong TorrentContentModelItem::size() const
|
qulonglong TorrentContentModelItem::size() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(!isRootItem());
|
Q_ASSERT(!isRootItem());
|
||||||
|
|
||||||
return m_size;
|
return m_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user