From f55e5d639d456f89f2a4a3bc1260ae4057a5feb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 24 Dec 2021 14:08:39 +0100 Subject: [PATCH] Fixed build with Qt < 5.14 --- src/data/twonavparser.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/data/twonavparser.cpp b/src/data/twonavparser.cpp index 02f7de9b..d75b99a7 100644 --- a/src/data/twonavparser.cpp +++ b/src/data/twonavparser.cpp @@ -2,6 +2,13 @@ #include "map/gcs.h" #include "twonavparser.h" + +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) +#define SKIP_EMPTY QString::SkipEmptyParts +#else // Qt 5.14 +#define SKIP_EMPTY Qt::SkipEmptyParts +#endif + static double lon(const QString &str) { QStringList l(str.split(QChar(0xBA))); @@ -116,8 +123,7 @@ bool TwoNavParser::parse(QFile *file, QList &tracks, }} break; case 'T': - {QStringList list(codec.toString(line).split(' ', - Qt::SkipEmptyParts)); + {QStringList list(codec.toString(line).split(' ', SKIP_EMPTY)); if (list.size() < 4) { _errorString = "Parse error"; return false; @@ -156,8 +162,7 @@ bool TwoNavParser::parse(QFile *file, QList &tracks, tracks.last().last().append(t);} break; case 'W': - {QStringList list(codec.toString(line).split(' ', - Qt::SkipEmptyParts)); + {QStringList list(codec.toString(line).split(' ', SKIP_EMPTY)); if (list.size() < 5) { _errorString = "Parse error"; return false; @@ -198,8 +203,7 @@ bool TwoNavParser::parse(QFile *file, QList &tracks, }} break; case 'R': - {QStringList list(codec.toString(line).split(',', - Qt::SkipEmptyParts)); + {QStringList list(codec.toString(line).split(',', SKIP_EMPTY)); routes.append(RouteData()); routes.last().setName(list.at(1)); route = true;}