1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-19 05:14:24 +02:00

Added support for waypoint links

This commit is contained in:
2019-10-14 01:16:38 +02:00
parent f2bfd584d0
commit d59a37466b
7 changed files with 52 additions and 1 deletions

View File

@ -23,6 +23,21 @@ QDateTime GPXParser::time()
return d;
}
Link GPXParser::link()
{
QString URL = _reader.attributes().value("href").toString();
QString text;
while (_reader.readNextStartElement()) {
if (_reader.name() == QLatin1String("text"))
text = _reader.readElementText();
else
_reader.skipCurrentElement();
}
return Link(URL, text);
}
Coordinates GPXParser::coordinates()
{
bool res;
@ -146,6 +161,8 @@ void GPXParser::waypointData(Waypoint &waypoint, SegmentData *autoRoute)
gh = number();
else if (_reader.name() == QLatin1String("time"))
waypoint.setTimestamp(time());
else if (_reader.name() == QLatin1String("link"))
waypoint.setLink(link());
else if (autoRoute && _reader.name() == QLatin1String("extensions"))
rteptExtensions(autoRoute);
else