From e0114ebffc71a5a1d5b9368906ee260c71f3bc12 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 26 Aug 2012 18:26:06 +0300 Subject: [PATCH] TorrentContentModel: Get rid of useless member --- src/torrentcontentmodelfolder.cpp | 4 ++-- src/torrentcontentmodelitem.cpp | 10 +--------- src/torrentcontentmodelitem.h | 1 - 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/torrentcontentmodelfolder.cpp b/src/torrentcontentmodelfolder.cpp index 5721437f0..0f33c5874 100644 --- a/src/torrentcontentmodelfolder.cpp +++ b/src/torrentcontentmodelfolder.cpp @@ -166,8 +166,8 @@ void TorrentContentModelFolder::updateProgress() if (child->priority() > 0) m_totalDone += child->totalDone(); } - //qDebug("Folder: total_done: %llu/%llu", total_done, getSize()); - Q_ASSERT(m_totalDone <= size()); + + Q_ASSERT(m_totalDone <= m_size); setProgress(m_totalDone); } diff --git a/src/torrentcontentmodelitem.cpp b/src/torrentcontentmodelitem.cpp index 2d107fbc7..63a534d00 100644 --- a/src/torrentcontentmodelitem.cpp +++ b/src/torrentcontentmodelitem.cpp @@ -36,7 +36,6 @@ TorrentContentModelItem::TorrentContentModelItem(TorrentContentModelFolder* parent) : m_parentItem(parent) - , m_progress(0) , m_priority(prio::NORMAL) , m_totalDone(0) { @@ -82,13 +81,6 @@ void TorrentContentModelItem::setProgress(qulonglong done) m_totalDone = done; Q_ASSERT(m_totalDone <= m_size); - qreal progress; - if (m_size > 0) - progress = m_totalDone / (double) m_size; - else - progress = 1.; - Q_ASSERT(progress >= 0. && progress <= 1.); - m_progress = progress; m_parentItem->updateProgress(); } @@ -131,7 +123,7 @@ QVariant TorrentContentModelItem::data(int column) const case COL_PRIO: return m_priority; case COL_PROGRESS: - return progress(); // XXX: m_progress ? + return progress(); case COL_SIZE: return m_size; default: diff --git a/src/torrentcontentmodelitem.h b/src/torrentcontentmodelitem.h index 38afa564a..6da18b8ac 100644 --- a/src/torrentcontentmodelitem.h +++ b/src/torrentcontentmodelitem.h @@ -77,7 +77,6 @@ protected: // Non-root item members QString m_name; qulonglong m_size; - float m_progress; int m_priority; qulonglong m_totalDone; };