SrmRide: Import marker names, aswell

so far marker names were ignored. Changed code to pick them up, aswell.
This commit is contained in:
Rainer Clasen
2012-03-22 10:52:09 +01:00
parent a452ccce1f
commit a375f7a4d0

View File

@@ -75,6 +75,7 @@ static qint32 readSignedLong(QDataStream &in)
struct marker
{
int start, end;
QString note;
};
struct blockhdr
@@ -170,6 +171,8 @@ RideFile *SrmFileReader::openRideFile(QFile &file, QStringList &errorStrings, QL
markers[i].end = end;
}
markers[i].note = QString( mcomment);
(void) active;
(void) avgwatts;
(void) avghr;
@@ -293,7 +296,10 @@ RideFile *SrmFileReader::openRideFile(QFile &file, QStringList &errorStrings, QL
int end = qMin(marker.end - 1, result->dataPoints().size() - 1);
double end_secs = result->dataPoints()[end]->secs + result->recIntSecs();
result->addInterval(last, start_secs, "");
result->addInterval(start_secs, end_secs, QString("%1").arg(i));
QString note = QString("%1").arg(i);
if( marker.note.length() )
note += QString(" ") + marker.note;
result->addInterval(start_secs, end_secs, note );
last = end_secs;
}
if (!markers.empty() && markers.last().end < result->dataPoints().size()) {