mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Redesign main core classes.
This commit is contained in:
@@ -38,7 +38,7 @@ TorrentContentModelItem::TorrentContentModelItem(TorrentContentModelFolder* pare
|
||||
: m_parentItem(parent)
|
||||
, m_size(0)
|
||||
, m_priority(prio::NORMAL)
|
||||
, m_totalDone(0)
|
||||
, m_progress(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -65,21 +65,14 @@ qulonglong TorrentContentModelItem::size() const
|
||||
return m_size;
|
||||
}
|
||||
|
||||
qulonglong TorrentContentModelItem::totalDone() const
|
||||
qreal TorrentContentModelItem::progress() const
|
||||
{
|
||||
Q_ASSERT(!isRootItem());
|
||||
return m_totalDone;
|
||||
}
|
||||
Q_ASSERT(!isRootItem());
|
||||
if (m_priority == prio::IGNORED) return 0;
|
||||
|
||||
float TorrentContentModelItem::progress() const
|
||||
{
|
||||
Q_ASSERT(!isRootItem());
|
||||
if (m_priority == prio::IGNORED)
|
||||
return 0;
|
||||
if (m_size > 0) return m_progress;
|
||||
|
||||
if (m_size > 0)
|
||||
return m_totalDone / (double) m_size;
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int TorrentContentModelItem::priority() const
|
||||
|
||||
Reference in New Issue
Block a user