diff --git a/src/torrentcontentmodel.cpp b/src/torrentcontentmodel.cpp index 112314c73..2b7fa58ec 100644 --- a/src/torrentcontentmodel.cpp +++ b/src/torrentcontentmodel.cpp @@ -124,12 +124,6 @@ bool TorrentContentModel::setData(const QModelIndex& index, const QVariant& valu case TorrentContentModelItem::COL_NAME: item->setName(value.toString()); break; - case TorrentContentModelItem::COL_SIZE: - item->setSize(value.toULongLong()); - break; - case TorrentContentModelItem::COL_PROGRESS: - item->setProgress(value.toDouble()); - break; case TorrentContentModelItem::COL_PRIO: item->setPriority(value.toInt()); break; diff --git a/src/torrentcontentmodelfolder.cpp b/src/torrentcontentmodelfolder.cpp index e9ade8da8..0e292fc36 100644 --- a/src/torrentcontentmodelfolder.cpp +++ b/src/torrentcontentmodelfolder.cpp @@ -170,5 +170,9 @@ void TorrentContentModelFolder::updateSize() if (child->priority() != prio::IGNORED) size += child->size(); } - setSize(size); + + if (size != m_size) { + m_size = size; + m_parentItem->updateSize(); + } } diff --git a/src/torrentcontentmodelitem.cpp b/src/torrentcontentmodelitem.cpp index c8add9b75..e9fdbc71f 100644 --- a/src/torrentcontentmodelitem.cpp +++ b/src/torrentcontentmodelitem.cpp @@ -63,16 +63,6 @@ qulonglong TorrentContentModelItem::size() const return m_size; } -void TorrentContentModelItem::setSize(qulonglong size) -{ - Q_ASSERT(!isRootItem()); - if (m_size == size) - return; - - m_size = size; - m_parentItem->updateSize(); -} - void TorrentContentModelItem::setProgress(qulonglong done) { Q_ASSERT(!isRootItem()); diff --git a/src/torrentcontentmodelitem.h b/src/torrentcontentmodelitem.h index 6da18b8ac..72f285940 100644 --- a/src/torrentcontentmodelitem.h +++ b/src/torrentcontentmodelitem.h @@ -57,7 +57,6 @@ public: void setName(const QString& name); qulonglong size() const; - void setSize(qulonglong size); qulonglong totalDone() const; void setProgress(qulonglong done);