| 286 | |
| 287 | |
| 288 | void CStatistics::Load() |
| 289 | { |
| 290 | CFile f; |
| 291 | |
| 292 | s_totalSent = 0; |
| 293 | s_totalReceived = 0; |
| 294 | try { |
| 295 | CPath path(JoinPaths(thePrefs::GetConfigDir(), "statistics.dat")); |
| 296 | if (path.FileExists() && f.Open(path)) { |
| 297 | uint8_t version = f.ReadUInt8(); |
| 298 | if (version == 0) { |
| 299 | s_totalSent = f.ReadUInt64(); |
| 300 | s_totalReceived = f.ReadUInt64(); |
| 301 | } |
| 302 | } |
| 303 | } catch (const CSafeIOException& e) { |
| 304 | AddLogLineN(e.what()); |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | |
| 309 | void CStatistics::Save() |
nothing calls this directly
no test coverage detected