PWX support make/model for TP.com upload

.. on request from TrainingPeaks we now add the make and model
   elements to a PWX file.

Fixes #593
This commit is contained in:
Mark Liversedge
2013-05-09 19:25:03 +01:00
parent 2887c0d3df
commit 2c5aced70f

View File

@@ -365,18 +365,25 @@ PwxFileReader::writeRideFile(MainWindow *main, const RideFile *ride, QFile &file
root.appendChild(goal);
}
// device type
if (ride->deviceType() != "") {
// device type
if (ride->deviceType() != "") {
QDomElement device = doc.createElement("device");
QDomElement device = doc.createElement("device");
device.setAttribute("id", ride->deviceType());
QDomElement make = doc.createElement("make");
text = doc.createTextNode(ride->deviceType());
make.appendChild(text);
device.appendChild(make);
root.appendChild(device);
}
QDomElement make = doc.createElement("make");
text = doc.createTextNode("Golden Cheetah");
make.appendChild(text);
device.appendChild(make);
QDomElement model = doc.createElement("model");
text = doc.createTextNode(ride->deviceType());
model.appendChild(text);
device.appendChild(model);
root.appendChild(device);
}
// time
QDomElement time = doc.createElement("time");
text = doc.createTextNode(ride->startTime().toString(Qt::ISODate));