mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-27 06:54:20 +00:00
Statistics: handle case where user has gone back to older version.
This commit is contained in:
parent
e4e3a56c9d
commit
8bbdcc78ce
@ -223,6 +223,15 @@ void TorrentSpeedMonitor::loadStats() {
|
||||
if (s_old.contains("Stats/AllStats")) {
|
||||
v = s_old.value("Stats/AllStats").toHash();
|
||||
dirty = true;
|
||||
|
||||
// If the user has used qbt > 3.1.5 and then reinstalled/used
|
||||
// qbt < 3.1.6, there will be stats in qbittorrent-data.ini too
|
||||
// so we need to merge those 2.
|
||||
if (s.contains("Stats/AllStats")) {
|
||||
QVariantHash tmp = s.value("Stats/AllStats").toHash();
|
||||
v["AlltimeDL"] = v["AlltimeDL"].toULongLong() + tmp["AlltimeDL"].toULongLong();
|
||||
v["AlltimeUL"] = v["AlltimeUL"].toULongLong() + tmp["AlltimeUL"].toULongLong();
|
||||
}
|
||||
}
|
||||
else
|
||||
v = s.value("Stats/AllStats").toHash();
|
||||
|
Loading…
x
Reference in New Issue
Block a user