mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Fixed build with Qt < 5.14
This commit is contained in:
parent
cedaeb1185
commit
f55e5d639d
@ -2,6 +2,13 @@
|
|||||||
#include "map/gcs.h"
|
#include "map/gcs.h"
|
||||||
#include "twonavparser.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)
|
static double lon(const QString &str)
|
||||||
{
|
{
|
||||||
QStringList l(str.split(QChar(0xBA)));
|
QStringList l(str.split(QChar(0xBA)));
|
||||||
@ -116,8 +123,7 @@ bool TwoNavParser::parse(QFile *file, QList<TrackData> &tracks,
|
|||||||
}}
|
}}
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
{QStringList list(codec.toString(line).split(' ',
|
{QStringList list(codec.toString(line).split(' ', SKIP_EMPTY));
|
||||||
Qt::SkipEmptyParts));
|
|
||||||
if (list.size() < 4) {
|
if (list.size() < 4) {
|
||||||
_errorString = "Parse error";
|
_errorString = "Parse error";
|
||||||
return false;
|
return false;
|
||||||
@ -156,8 +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(' ',
|
{QStringList list(codec.toString(line).split(' ', SKIP_EMPTY));
|
||||||
Qt::SkipEmptyParts));
|
|
||||||
if (list.size() < 5) {
|
if (list.size() < 5) {
|
||||||
_errorString = "Parse error";
|
_errorString = "Parse error";
|
||||||
return false;
|
return false;
|
||||||
@ -198,8 +203,7 @@ bool TwoNavParser::parse(QFile *file, QList<TrackData> &tracks,
|
|||||||
}}
|
}}
|
||||||
break;
|
break;
|
||||||
case 'R':
|
case 'R':
|
||||||
{QStringList list(codec.toString(line).split(',',
|
{QStringList list(codec.toString(line).split(',', SKIP_EMPTY));
|
||||||
Qt::SkipEmptyParts));
|
|
||||||
routes.append(RouteData());
|
routes.append(RouteData());
|
||||||
routes.last().setName(list.at(1));
|
routes.last().setName(list.at(1));
|
||||||
route = true;}
|
route = true;}
|
||||||
|
Loading…
Reference in New Issue
Block a user