1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Demangle waypoint names

This commit is contained in:
Martin Tůma 2021-12-24 14:40:01 +01:00
parent f55e5d639d
commit 421ab19e7a

View File

@ -123,7 +123,7 @@ bool TwoNavParser::parse(QFile *file, QList<TrackData> &tracks,
}} }}
break; break;
case 'T': case 'T':
{QStringList list(codec.toString(line).split(' ', SKIP_EMPTY)); {QStringList list(codec.toString(line).split(' ', SKIP_EMPTY));
if (list.size() < 4) { if (list.size() < 4) {
_errorString = "Parse error"; _errorString = "Parse error";
return false; return false;
@ -162,7 +162,7 @@ bool TwoNavParser::parse(QFile *file, QList<TrackData> &tracks,
tracks.last().last().append(t);} tracks.last().last().append(t);}
break; break;
case 'W': case 'W':
{QStringList list(codec.toString(line).split(' ', SKIP_EMPTY)); {QStringList list(codec.toString(line).split(' ', SKIP_EMPTY));
if (list.size() < 5) { if (list.size() < 5) {
_errorString = "Parse error"; _errorString = "Parse error";
return false; return false;
@ -174,7 +174,8 @@ bool TwoNavParser::parse(QFile *file, QList<TrackData> &tracks,
} }
Waypoint w(gcs.toWGS84(c)); Waypoint w(gcs.toWGS84(c));
w.setName(list.at(1)); QString name(list.at(1));
w.setName(name.replace('_', ' ').trimmed());
if (list.size() > 6) { if (list.size() > 6) {
QDateTime ts(timestamp(list.at(5), list.at(6))); QDateTime ts(timestamp(list.at(5), list.at(6)));
@ -203,7 +204,7 @@ bool TwoNavParser::parse(QFile *file, QList<TrackData> &tracks,
}} }}
break; break;
case 'R': case 'R':
{QStringList list(codec.toString(line).split(',', SKIP_EMPTY)); {QStringList list(codec.toString(line).split(',', SKIP_EMPTY));
routes.append(RouteData()); routes.append(RouteData());
routes.last().setName(list.at(1)); routes.last().setName(list.at(1));
route = true;} route = true;}