diff --git a/src/tcxparser.cpp b/src/tcxparser.cpp index c9abfb1b..10116d34 100644 --- a/src/tcxparser.cpp +++ b/src/tcxparser.cpp @@ -183,7 +183,7 @@ void TCXParser::courses(QList &tracks, QList &waypoints) } } -void TCXParser::activities(QList &tracks) +void TCXParser::sport(QList &tracks) { while (_reader.readNextStartElement()) { if (_reader.name() == "Activity") { @@ -194,6 +194,29 @@ void TCXParser::activities(QList &tracks) } } +void TCXParser::multiSportSession(QList &tracks) +{ + while (_reader.readNextStartElement()) { + if (_reader.name() == "FirstSport" || _reader.name() == "NextSport") + sport(tracks); + else + _reader.skipCurrentElement(); + } +} + +void TCXParser::activities(QList &tracks) +{ + while (_reader.readNextStartElement()) { + if (_reader.name() == "Activity") { + tracks.append(TrackData()); + activity(tracks.back()); + } else if (_reader.name() == "MultiSportSession") + multiSportSession(tracks); + else + _reader.skipCurrentElement(); + } +} + void TCXParser::tcx(QList &tracks, QList &waypoints) { while (_reader.readNextStartElement()) { diff --git a/src/tcxparser.h b/src/tcxparser.h index b1490c65..e5b82d4c 100644 --- a/src/tcxparser.h +++ b/src/tcxparser.h @@ -19,6 +19,8 @@ private: void tcx(QList &tracks, QList &waypoints); void courses(QList &tracks, QList &waypoints); void activities(QList &tracks); + void multiSportSession(QList &tracks); + void sport(QList &tracks); void course(QList &waypoints, TrackData &track); void activity(TrackData &track); void lap(TrackData &track);