mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
File Export (part 1 of 2)
The export functions in mainwindow are getting quite cumbersome with multiple menu options. This patch creates a single menu option "Export.." which allows the user to select a supported format and a filename. To support this the ridefile reader code needed to be adjusted to allow registered readers to declare capability to write and use a consistent (virtual) method to do so. By modifying the base class for ride file reader we now allow new readers to register both read and write capability.
This commit is contained in:
@@ -260,7 +260,7 @@ PwxFileReader::PwxFromDomDoc(QDomDocument doc, QStringList &errors) const
|
||||
}
|
||||
|
||||
bool
|
||||
PwxFileReader::writeRideFile(const QString cyclist, const RideFile *ride, QFile &file) const
|
||||
PwxFileReader::writeRideFile(MainWindow *main, const RideFile *ride, QFile &file) const
|
||||
{
|
||||
QDomText text; // used all over
|
||||
QDomDocument doc;
|
||||
@@ -282,9 +282,9 @@ PwxFileReader::writeRideFile(const QString cyclist, const RideFile *ride, QFile
|
||||
// athlete details
|
||||
QDomElement athlete = doc.createElement("athlete");
|
||||
QDomElement name = doc.createElement("name");
|
||||
text = doc.createTextNode(cyclist); name.appendChild(text);
|
||||
text = doc.createTextNode(main->cyclist); name.appendChild(text);
|
||||
athlete.appendChild(name);
|
||||
double cyclistweight = ride->getTag("Weight", appsettings->cvalue(cyclist, GC_WEIGHT, 0.0).toString()).toDouble();
|
||||
double cyclistweight = ride->getTag("Weight", appsettings->cvalue(main->cyclist, GC_WEIGHT, 0.0).toString()).toDouble();
|
||||
if (cyclistweight) {
|
||||
QDomElement weight = doc.createElement("weight");
|
||||
text = doc.createTextNode(QString("%1").arg(cyclistweight));
|
||||
|
||||
Reference in New Issue
Block a user