1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Simplify code

This commit is contained in:
Chocobo1 2019-08-21 17:43:55 +08:00
parent bbecf87292
commit fba72f5fb7
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -136,9 +136,9 @@ QVariantMap serialize(const BitTorrent::TorrentHandle &torrent)
ret[KEY_TORRENT_LAST_ACTIVITY_TIME] = 0; ret[KEY_TORRENT_LAST_ACTIVITY_TIME] = 0;
} }
else { else {
QDateTime dt = QDateTime::currentDateTime(); const qint64 dt = (QDateTime::currentDateTime().toSecsSinceEpoch()
dt = dt.addSecs(-torrent.timeSinceActivity()); - torrent.timeSinceActivity());
ret[KEY_TORRENT_LAST_ACTIVITY_TIME] = dt.toSecsSinceEpoch(); ret[KEY_TORRENT_LAST_ACTIVITY_TIME] = dt;
} }
return ret; return ret;