mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
Fixed broaken loading of KML files with multitracks and folder element outside document element
This commit is contained in:
parent
d3193abd0b
commit
57a171ee8c
@ -251,6 +251,16 @@ void KMLParser::track(TrackData &track)
|
|||||||
_reader.raiseError(mismatchError);
|
_reader.raiseError(mismatchError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KMLParser::multiTrack(TrackData &t)
|
||||||
|
{
|
||||||
|
while (_reader.readNextStartElement()) {
|
||||||
|
if (_reader.name() == "Track")
|
||||||
|
track(t);
|
||||||
|
else
|
||||||
|
_reader.skipCurrentElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void KMLParser::multiGeometry(QList<TrackData> &tracks,
|
void KMLParser::multiGeometry(QList<TrackData> &tracks,
|
||||||
QList<Waypoint> &waypoints, const QString &name, const QString &desc,
|
QList<Waypoint> &waypoints, const QString &name, const QString &desc,
|
||||||
const QDateTime timestamp)
|
const QDateTime timestamp)
|
||||||
@ -308,6 +318,12 @@ void KMLParser::placemark(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
|
|||||||
t.setName(name);
|
t.setName(name);
|
||||||
t.setDescription(desc);
|
t.setDescription(desc);
|
||||||
track(t);
|
track(t);
|
||||||
|
} else if (_reader.name() == "MultiTrack") {
|
||||||
|
tracks.append(TrackData());
|
||||||
|
TrackData &t = tracks.last();
|
||||||
|
t.setName(name);
|
||||||
|
t.setDescription(desc);
|
||||||
|
multiTrack(t);
|
||||||
} else
|
} else
|
||||||
_reader.skipCurrentElement();
|
_reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
@ -344,6 +360,8 @@ void KMLParser::kml(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
|
|||||||
document(tracks, waypoints);
|
document(tracks, waypoints);
|
||||||
else if (_reader.name() == "Placemark")
|
else if (_reader.name() == "Placemark")
|
||||||
placemark(tracks, waypoints);
|
placemark(tracks, waypoints);
|
||||||
|
else if (_reader.name() == "Folder")
|
||||||
|
folder(tracks, waypoints);
|
||||||
else
|
else
|
||||||
_reader.skipCurrentElement();
|
_reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ private:
|
|||||||
void multiGeometry(QList<TrackData> &tracks, QList<Waypoint> &waypoints,
|
void multiGeometry(QList<TrackData> &tracks, QList<Waypoint> &waypoints,
|
||||||
const QString &name, const QString &desc, const QDateTime timestamp);
|
const QString &name, const QString &desc, const QDateTime timestamp);
|
||||||
void track(TrackData &track);
|
void track(TrackData &track);
|
||||||
|
void multiTrack(TrackData &t);
|
||||||
void lineString(TrackData &track);
|
void lineString(TrackData &track);
|
||||||
void point(Waypoint &waypoint);
|
void point(Waypoint &waypoint);
|
||||||
bool pointCoordinates(Waypoint &waypoint);
|
bool pointCoordinates(Waypoint &waypoint);
|
||||||
|
Loading…
Reference in New Issue
Block a user