mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
Fix Polar ride parser crash
Tacx HRM exporter does not create an [IntTimes] section. When the [HRDate] section is encountered, This patch creates a single interval in the intervals list, which has the length of the complete ride. Fixes #23
This commit is contained in:
committed by
Mark Liversedge
parent
87a6f9e628
commit
f6b5cd2790
@@ -94,8 +94,13 @@ RideFile *PolarFileReader::openRideFile(QFile &file, QStringList &errors) const
|
||||
else if (line.startsWith("[")) {
|
||||
//fprintf(stderr, "section : %s\n", line.toAscii().constData());
|
||||
section=line;
|
||||
if (section == "[HRData]")
|
||||
if (section == "[HRData]") {
|
||||
// Some systems, like the Tacx HRM exporter, do not add an [IntTimes] section, so we need to
|
||||
// specify that the whole ride is one big interval.
|
||||
if (intervals.isEmpty())
|
||||
intervals.append(seconds);
|
||||
next_interval = intervals.at(0);
|
||||
}
|
||||
}
|
||||
else if (section == "[Params]"){
|
||||
if (line.contains("Version=")) {
|
||||
|
||||
Reference in New Issue
Block a user