1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-30 22:51:16 +01:00

Propper entry text trim

This commit is contained in:
Martin Tůma 2021-05-10 08:26:19 +02:00
parent 411428718e
commit 5efd3d1e33

View File

@ -22,11 +22,11 @@ bool OV2Parser::parse(QFile *file, QList<TrackData> &tracks,
switch (type) { switch (type) {
case 0: case 0:
stream >> len; stream >> len;
if (stream.status() != QDataStream::Ok || len < 5) { if (stream.status() != QDataStream::Ok || len < 5
|| stream.skipRawData(len - 5) < (int)len - 5) {
_errorString = "Corrupted deleted record"; _errorString = "Corrupted deleted record";
return false; return false;
} }
stream.skipRawData(len - 5);
break; break;
case 1: case 1:
if (stream.skipRawData(20) < 20) { if (stream.skipRawData(20) < 20) {
@ -52,12 +52,8 @@ bool OV2Parser::parse(QFile *file, QList<TrackData> &tracks,
return false; return false;
} }
Waypoint wp(Coordinates(lon/1e5, lat/1e5)); Waypoint wp(Coordinates(lon/1e5, lat/1e5));
if (type == 2) QList<QByteArray> parts(ba.split('\0'));
wp.setName(codec.toString(ba)); wp.setName(codec.toString(parts.first()));
else {
QList<QByteArray> parts(ba.split('\0'));
wp.setName(codec.toString(parts.at(0)));
}
waypoints.append(wp);} waypoints.append(wp);}
break; break;
default: default: