From f3c0ed3f7fa488219e40868614b6a0100a03cd22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 14 May 2021 22:47:09 +0200 Subject: [PATCH] Added workaround for broken IGC files created by XCSoar closes #371 --- src/data/igcparser.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/data/igcparser.cpp b/src/data/igcparser.cpp index f8362990..857d5bdf 100644 --- a/src/data/igcparser.cpp +++ b/src/data/igcparser.cpp @@ -240,8 +240,11 @@ bool IGCParser::parse(QFile *file, QList &tracks, } } else if (line[0] == 'B') { if (ctx.date.isNull()) { - _errorString = "Missing date header"; - return false; + /* The date H header is mandatory, but XCSOAR generates + files without it, so add a dummy date in such case */ + qWarning("%s: Missing date header", + qPrintable(file->fileName())); + ctx.date = QDate(1970, 1, 1); } if (!track) { tracks.append(TrackData());