From 731b309ac9a947b9f05a5a853922908fc6d08a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Tue, 10 Nov 2020 20:07:46 +0100 Subject: [PATCH] Remove the special timestamps check from the FIT parser (Use the common logic in the Track class instead) --- src/data/fitparser.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/data/fitparser.cpp b/src/data/fitparser.cpp index a6f53b1b..08ba95be 100644 --- a/src/data/fitparser.cpp +++ b/src/data/fitparser.cpp @@ -51,13 +51,13 @@ class FITParser::CTX { public: CTX(QFile *file, QVector &waypoints) : file(file), waypoints(waypoints), len(0), endian(0), timestamp(0), - lastWrite(0), ratio(NAN) {} + ratio(NAN) {} QFile *file; QVector &waypoints; quint32 len; quint8 endian; - quint32 timestamp, lastWrite; + quint32 timestamp; MessageDefinition defs[16]; qreal ratio; Trackpoint trackpoint; @@ -361,14 +361,12 @@ bool FITParser::parseData(CTX &ctx, const MessageDefinition *def) ctx.ratio = ((qreal)front / (qreal)rear); } } else if (def->globalId == RECORD_MESSAGE) { - if (ctx.timestamp > ctx.lastWrite - && ctx.trackpoint.coordinates().isValid()) { + if (ctx.trackpoint.coordinates().isValid()) { ctx.trackpoint.setTimestamp(QDateTime::fromTime_t(ctx.timestamp + 631065600)); ctx.trackpoint.setRatio(ctx.ratio); ctx.segment.append(ctx.trackpoint); ctx.trackpoint = Trackpoint(); - ctx.lastWrite = ctx.timestamp; } } else if (def->globalId == COURSE_POINT) if (waypoint.coordinates().isValid())