diff --git a/src/kmlparser.cpp b/src/kmlparser.cpp index bca65464..c28def54 100644 --- a/src/kmlparser.cpp +++ b/src/kmlparser.cpp @@ -251,6 +251,16 @@ void KMLParser::track(TrackData &track) _reader.raiseError(mismatchError); } +void KMLParser::multiTrack(TrackData &t) +{ + while (_reader.readNextStartElement()) { + if (_reader.name() == "Track") + track(t); + else + _reader.skipCurrentElement(); + } +} + void KMLParser::multiGeometry(QList &tracks, QList &waypoints, const QString &name, const QString &desc, const QDateTime timestamp) @@ -308,6 +318,12 @@ void KMLParser::placemark(QList &tracks, QList &waypoints) t.setName(name); t.setDescription(desc); track(t); + } else if (_reader.name() == "MultiTrack") { + tracks.append(TrackData()); + TrackData &t = tracks.last(); + t.setName(name); + t.setDescription(desc); + multiTrack(t); } else _reader.skipCurrentElement(); } @@ -344,6 +360,8 @@ void KMLParser::kml(QList &tracks, QList &waypoints) document(tracks, waypoints); else if (_reader.name() == "Placemark") placemark(tracks, waypoints); + else if (_reader.name() == "Folder") + folder(tracks, waypoints); else _reader.skipCurrentElement(); } diff --git a/src/kmlparser.h b/src/kmlparser.h index 54aa4062..de197aba 100644 --- a/src/kmlparser.h +++ b/src/kmlparser.h @@ -23,6 +23,7 @@ private: void multiGeometry(QList &tracks, QList &waypoints, const QString &name, const QString &desc, const QDateTime timestamp); void track(TrackData &track); + void multiTrack(TrackData &t); void lineString(TrackData &track); void point(Waypoint &waypoint); bool pointCoordinates(Waypoint &waypoint);