diff --git a/src/data/tcxparser.cpp b/src/data/tcxparser.cpp index 3eae25e4..526ebd20 100644 --- a/src/data/tcxparser.cpp +++ b/src/data/tcxparser.cpp @@ -66,13 +66,25 @@ void TCXParser::heartRateBpm(Trackpoint &trackpoint) } } -void TCXParser::extensions(Trackpoint &trackpoint) +void TCXParser::TPX(Trackpoint &trackpoint) { while (_reader.readNextStartElement()) { if (_reader.name() == QLatin1String("RunCadence")) trackpoint.setCadence(number()); else if (_reader.name() == QLatin1String("Watts")) trackpoint.setPower(number()); + else if (_reader.name() == QLatin1String("Speed")) + trackpoint.setSpeed(number()); + else + _reader.skipCurrentElement(); + } +} + +void TCXParser::extensions(Trackpoint &trackpoint) +{ + while (_reader.readNextStartElement()) { + if (_reader.name() == QLatin1String("TPX")) + TPX(trackpoint); else _reader.skipCurrentElement(); } diff --git a/src/data/tcxparser.h b/src/data/tcxparser.h index 1ba692a6..685668b3 100644 --- a/src/data/tcxparser.h +++ b/src/data/tcxparser.h @@ -26,6 +26,7 @@ private: void trackpointData(Trackpoint &trackpoint); void waypointData(Waypoint &waypoint); void extensions(Trackpoint &trackpoint); + void TPX(Trackpoint &trackpoint); void heartRateBpm(Trackpoint &trackpoint); Coordinates position(); qreal number();