mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Fix build using qt < 4.7 Closes #1385
This commit is contained in:
parent
26e6787e85
commit
534a94310d
1 changed files with 8 additions and 0 deletions
|
@ -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() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue