From a42280dec3f8ed13e173054a0cf28aeb14e1ea62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 24 Dec 2021 15:09:19 +0100 Subject: [PATCH] Parse waypoint symbols + fixed error handling --- src/data/twonavparser.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/data/twonavparser.cpp b/src/data/twonavparser.cpp index 99245d0d..1b41ffe3 100644 --- a/src/data/twonavparser.cpp +++ b/src/data/twonavparser.cpp @@ -203,10 +203,17 @@ bool TwoNavParser::parse(QFile *file, QList &tracks, waypoint = true; }} break; + case 'w': + {line.remove(0, 1); + QStringList list(codec.toString(line).split(',')); + if (list.size() && waypoints.size()) + waypoints.last().setSymbol(list.at(0).trimmed());} + break; case 'R': - {QStringList list(codec.toString(line).split(',', SKIP_EMPTY)); + {QStringList list(codec.toString(line).split(',')); routes.append(RouteData()); - routes.last().setName(list.at(1)); + if (list.size() > 1) + routes.last().setName(list.at(1)); route = true;} break; }