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

OziExplorer files styles support

This commit is contained in:
Martin Tůma 2022-09-26 22:51:17 +02:00
parent 05bcbddf77
commit a019ff3930

View File

@ -61,6 +61,9 @@ bool PLTParser::parse(QFile *file, QList<TrackData> &tracks,
} }
} else if (_errorLine == 5) { } else if (_errorLine == 5) {
QList<QByteArray> list = line.split(','); QList<QByteArray> list = line.split(',');
if (list.size() >= 3 && !list.at(2).isEmpty())
track.setStyle(LineStyle(QColor(list.at(2).toUInt()),
list.at(1).toUInt()));
if (list.size() >= 4) if (list.size() >= 4)
track.setName(list.at(3)); track.setName(list.at(3));
} else if (_errorLine > 6) { } else if (_errorLine > 6) {
@ -166,6 +169,9 @@ bool RTEParser::parse(QFile *file, QList<TrackData> &tracks,
QByteArray description(list.at(3).trimmed()); QByteArray description(list.at(3).trimmed());
routes.last().setDescription(decode(description)); routes.last().setDescription(decode(description));
} }
if (list.size() >= 5 && !list.at(4).isEmpty())
routes.last().setStyle(
LineStyle(QColor(list.at(4).toUInt())));
} else if (list.at(0).trimmed() == "W") { } else if (list.at(0).trimmed() == "W") {
if (!record || list.size() < 7) { if (!record || list.size() < 7) {
_errorString = "Parse error"; _errorString = "Parse error";
@ -282,6 +288,8 @@ bool WPTParser::parse(QFile *file, QList<TrackData> &tracks,
delphi2unixMS(date))); delphi2unixMS(date)));
} }
} }
if (list.size() >= 9 && !list.at(8).isEmpty())
wp.setStyle(PointStyle(QColor(list.at(8).toUInt())));
if (list.size() >= 11) { if (list.size() >= 11) {
QByteArray description(list.at(10).trimmed()); QByteArray description(list.at(10).trimmed());
if (!description.isEmpty()) if (!description.isEmpty())