mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-09 09:02:31 -06:00
Fix build using qt < 4.7 Closes #1385
This commit is contained in:
committed by
sledgehammer999
parent
26e6787e85
commit
534a94310d
@@ -203,7 +203,11 @@ void TorrentSpeedMonitor::getSamples()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TorrentSpeedMonitor::saveStats() const {
|
void TorrentSpeedMonitor::saveStats() const {
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
|
||||||
|
if (!(dirty && (QDateTime().toTime_t() * 1000 - lastWrite >= 15*60*1000) ))
|
||||||
|
#else
|
||||||
if (!(dirty && (QDateTime::currentMSecsSinceEpoch() - lastWrite >= 15*60*1000) ))
|
if (!(dirty && (QDateTime::currentMSecsSinceEpoch() - lastWrite >= 15*60*1000) ))
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
QIniSettings s("qBittorrent", "qBittorrent-data");
|
QIniSettings s("qBittorrent", "qBittorrent-data");
|
||||||
QVariantHash v;
|
QVariantHash v;
|
||||||
@@ -211,7 +215,11 @@ void TorrentSpeedMonitor::saveStats() const {
|
|||||||
v.insert("AlltimeUL", alltimeUL + sessionUL);
|
v.insert("AlltimeUL", alltimeUL + sessionUL);
|
||||||
s.setValue("Stats/AllStats", v);
|
s.setValue("Stats/AllStats", v);
|
||||||
dirty = false;
|
dirty = false;
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
|
||||||
|
lastWrite = QDateTime().toTime_t() * 1000;
|
||||||
|
#else
|
||||||
lastWrite = QDateTime::currentMSecsSinceEpoch();
|
lastWrite = QDateTime::currentMSecsSinceEpoch();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentSpeedMonitor::loadStats() {
|
void TorrentSpeedMonitor::loadStats() {
|
||||||
|
|||||||
Reference in New Issue
Block a user