Skip to content

Commit

Permalink
Use consistent number-to-string conversion
Browse files Browse the repository at this point in the history
This also reduces the chance of bad data resulting in broken / invalid
TCX files.

Relates to issue #16.
  • Loading branch information
pcolby committed Aug 1, 2014
1 parent 2388e12 commit abe1415
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/polar/v2/trainingsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1474,10 +1474,12 @@ QDomDocument TrainingSession::toTCX(const QString &buildTime) const
const QVariantMap hrStats = firstMap(stats.value(QLatin1String("heartrate")));
lap.appendChild(doc.createElement(QLatin1String("AverageHeartRateBpm")))
.appendChild(doc.createElement(QLatin1String("Value")))
.appendChild(doc.createTextNode(first(hrStats.value(QLatin1String("average"))).toString()));
.appendChild(doc.createTextNode(QString::fromLatin1("%1")
.arg(first(hrStats.value(QLatin1String("average"))).toUInt())));
lap.appendChild(doc.createElement(QLatin1String("MaximumHeartRateBpm")))
.appendChild(doc.createElement(QLatin1String("Value")))
.appendChild(doc.createTextNode(first(hrStats.value(QLatin1String("maximum"))).toString()));
.appendChild(doc.createTextNode(QString::fromLatin1("%1")
.arg(first(hrStats.value(QLatin1String("maximum"))).toUInt())));
/// @todo Intensity must be one of: Active, Resting.
lap.appendChild(doc.createElement(QLatin1String("Intensity")))
.appendChild(doc.createTextNode(QString::fromLatin1("Active")));
Expand Down

0 comments on commit abe1415

Please sign in to comment.