mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 08:27:24 -06:00
Use signed integer type for counters
This commit is contained in:
@@ -42,10 +42,6 @@ using namespace BitTorrent;
|
||||
Statistics::Statistics(Session *session)
|
||||
: QObject(session)
|
||||
, m_session(session)
|
||||
, m_sessionUL(0)
|
||||
, m_sessionDL(0)
|
||||
, m_lastWrite(0)
|
||||
, m_dirty(false)
|
||||
{
|
||||
load();
|
||||
connect(&m_timer, &QTimer::timeout, this, &Statistics::gather);
|
||||
@@ -59,12 +55,12 @@ Statistics::~Statistics()
|
||||
save();
|
||||
}
|
||||
|
||||
quint64 Statistics::getAlltimeDL() const
|
||||
qint64 Statistics::getAlltimeDL() const
|
||||
{
|
||||
return m_alltimeDL + m_sessionDL;
|
||||
}
|
||||
|
||||
quint64 Statistics::getAlltimeUL() const
|
||||
qint64 Statistics::getAlltimeUL() const
|
||||
{
|
||||
return m_alltimeUL + m_sessionUL;
|
||||
}
|
||||
@@ -95,8 +91,8 @@ void Statistics::save() const
|
||||
|
||||
SettingsPtr s = Profile::instance()->applicationSettings(u"qBittorrent-data"_qs);
|
||||
QVariantHash v;
|
||||
v.insert(u"AlltimeDL"_qs, m_alltimeDL + m_sessionDL);
|
||||
v.insert(u"AlltimeUL"_qs, m_alltimeUL + m_sessionUL);
|
||||
v.insert(u"AlltimeDL"_qs, (m_alltimeDL + m_sessionDL));
|
||||
v.insert(u"AlltimeUL"_qs, (m_alltimeUL + m_sessionUL));
|
||||
s->setValue(u"Stats/AllStats"_qs, v);
|
||||
m_dirty = false;
|
||||
m_lastWrite = now;
|
||||
|
||||
Reference in New Issue
Block a user