RideFile::intervals_ now array of pointers

.. so we can keep a reference to the user interval
   in a ridefile from the rideitem and not worry about
   trying to match or handle index offsets into the array

.. this is required to fixup the relationship between
   an IntervalItem and a RideFileInterval in RideItem
   and RideFile respectively.
This commit is contained in:
Mark Liversedge
2015-05-18 13:57:21 +01:00
parent 2912982132
commit d5ae1bf685
9 changed files with 85 additions and 92 deletions

View File

@@ -749,13 +749,13 @@ PwxFileReader::writeRideFile(Context *context, const RideFile *ride, QFile &file
}
// interval "segments"
foreach (RideFileInterval i, ride->intervals()) {
foreach (RideFileInterval *i, ride->intervals()) {
QDomElement segment = doc.createElement("segment");
root.appendChild(segment);
// name
QDomElement name = doc.createElement("name");
text = doc.createTextNode(i.name); name.appendChild(text);
text = doc.createTextNode(i->name); name.appendChild(text);
segment.appendChild(name);
// summarydata
@@ -764,13 +764,13 @@ PwxFileReader::writeRideFile(Context *context, const RideFile *ride, QFile &file
// beginning
QDomElement beginning = doc.createElement("beginning");
text = doc.createTextNode(QString("%1").arg(i.start));
text = doc.createTextNode(QString("%1").arg(i->start));
beginning.appendChild(text);
summarydata.appendChild(beginning);
// duration
QDomElement duration = doc.createElement("duration");
text = doc.createTextNode(QString("%1").arg(i.stop - i.start));
text = doc.createTextNode(QString("%1").arg(i->stop - i->start));
duration.appendChild(text);
summarydata.appendChild(duration);
}