| 319 | } docs; |
| 320 | |
| 321 | void AnalyticsSerialise(Analytics &serdb, QVariantMap &values, AnalyticsSerialiseType type) |
| 322 | { |
| 323 | bool reporting = type == AnalyticsSerialiseType::Reporting; |
| 324 | |
| 325 | // only check this on 64-bit as it is different on 32-bit |
| 326 | #if QT_POINTER_SIZE == 8 && defined(Q_OS_WIN32) |
| 327 | static_assert(sizeof(Analytics) == 149, "Sizeof Analytics has changed - update serialisation."); |
| 328 | #endif |
| 329 | |
| 330 | QString doc; |
| 331 | |
| 332 | doc += lit("<h1>Report Explained</h1>"); |
| 333 | |
| 334 | ANALYTIC_SERIALISE(Version); |
| 335 | |
| 336 | ANALYTIC_SECTION(Date); |
| 337 | { |
| 338 | ANALYTIC_SERIALISE(Date.Year); |
| 339 | ANALYTIC_SERIALISE(Date.Month); |
| 340 | } |
| 341 | |
| 342 | ANALYTIC_SECTION(Metadata); |
| 343 | { |
| 344 | ANALYTIC_SERIALISE(Metadata.RenderDocVersion); |
| 345 | ANALYTIC_SERIALISE(Metadata.DistributionVersion); |
| 346 | ANALYTIC_SERIALISE(Metadata.OSVersion); |
| 347 | ANALYTIC_SERIALISE(Metadata.Bitness); |
| 348 | ANALYTIC_SERIALISE(Metadata.DevelBuildRun); |
| 349 | ANALYTIC_SERIALISE(Metadata.OfficialBuildRun); |
| 350 | |
| 351 | // special handling for reporting DaysUsed, to flatten into a number |
| 352 | if(reporting) |
| 353 | { |
| 354 | int sum = 0; |
| 355 | for(bool day : Analytics::db->Metadata.DaysUsed) |
| 356 | sum += day ? 1 : 0; |
| 357 | |
| 358 | saveTo(values, lit("Metadata.DaysUsed"), sum, reporting); |
| 359 | } |
| 360 | else |
| 361 | { |
| 362 | ANALYTIC_SERIALISE(Metadata.DaysUsed); |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | ANALYTIC_SECTION(Performance); |
| 367 | { |
| 368 | ANALYTIC_SERIALISE(Performance.LoadTime); |
| 369 | } |
| 370 | |
| 371 | doc += lit("<h2>API/GPU Usage</h2>"); |
| 372 | |
| 373 | ANALYTIC_SERIALISE(APIs); |
| 374 | ANALYTIC_SERIALISE(GPUVendors); |
| 375 | |
| 376 | ANALYTIC_SECTION(UIFeatures); |
| 377 | { |
| 378 | ANALYTIC_SERIALISE(UIFeatures.Bookmarks); |
no test coverage detected