mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-29 16:04:21 +00:00
TorrentContentModel: Get rid of useless member
This commit is contained in:
parent
0fdacf4d54
commit
e0114ebffc
@ -166,8 +166,8 @@ void TorrentContentModelFolder::updateProgress()
|
|||||||
if (child->priority() > 0)
|
if (child->priority() > 0)
|
||||||
m_totalDone += child->totalDone();
|
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);
|
setProgress(m_totalDone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
|
|
||||||
TorrentContentModelItem::TorrentContentModelItem(TorrentContentModelFolder* parent)
|
TorrentContentModelItem::TorrentContentModelItem(TorrentContentModelFolder* parent)
|
||||||
: m_parentItem(parent)
|
: m_parentItem(parent)
|
||||||
, m_progress(0)
|
|
||||||
, m_priority(prio::NORMAL)
|
, m_priority(prio::NORMAL)
|
||||||
, m_totalDone(0)
|
, m_totalDone(0)
|
||||||
{
|
{
|
||||||
@ -82,13 +81,6 @@ void TorrentContentModelItem::setProgress(qulonglong done)
|
|||||||
|
|
||||||
m_totalDone = done;
|
m_totalDone = done;
|
||||||
Q_ASSERT(m_totalDone <= m_size);
|
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();
|
m_parentItem->updateProgress();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +123,7 @@ QVariant TorrentContentModelItem::data(int column) const
|
|||||||
case COL_PRIO:
|
case COL_PRIO:
|
||||||
return m_priority;
|
return m_priority;
|
||||||
case COL_PROGRESS:
|
case COL_PROGRESS:
|
||||||
return progress(); // XXX: m_progress ?
|
return progress();
|
||||||
case COL_SIZE:
|
case COL_SIZE:
|
||||||
return m_size;
|
return m_size;
|
||||||
default:
|
default:
|
||||||
|
@ -77,7 +77,6 @@ protected:
|
|||||||
// Non-root item members
|
// Non-root item members
|
||||||
QString m_name;
|
QString m_name;
|
||||||
qulonglong m_size;
|
qulonglong m_size;
|
||||||
float m_progress;
|
|
||||||
int m_priority;
|
int m_priority;
|
||||||
qulonglong m_totalDone;
|
qulonglong m_totalDone;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user