diff --git a/src/Cloud/SixCycle.cpp b/src/Cloud/SixCycle.cpp index afe20f3704..589ab879cb 100644 --- a/src/Cloud/SixCycle.cpp +++ b/src/Cloud/SixCycle.cpp @@ -236,7 +236,7 @@ SixCycle::readdir(QString path, QStringList &errors, QDateTime from, QDateTime t // did we get a good response ? QByteArray r = reply->readAll(); - printd("response begins: %s ...\n", r.toStdString().substr(0,300).c_str()); + printd("response begins: %s ...\n", r.toStdString().substr(0,900).c_str()); QJsonParseError parseError; QJsonDocument document = QJsonDocument::fromJson(r, &parseError); @@ -259,8 +259,8 @@ SixCycle::readdir(QString path, QStringList &errors, QDateTime from, QDateTime t add->id = each["url"].toString(); add->label = QString("%1").arg(each["id"].toInt()); add->isDir = false; - add->distance = 0; // NA - add->duration = 0; // NA + add->distance = double(each["meters_in_distance"].toInt()) / 1000.0f; + add->duration = double(each["seconds_in_activity"].toInt()); //add->size //add->modified diff --git a/src/FileIO/PwxRideFile.cpp b/src/FileIO/PwxRideFile.cpp index 9d57765e6d..0e8e6e1bae 100644 --- a/src/FileIO/PwxRideFile.cpp +++ b/src/FileIO/PwxRideFile.cpp @@ -891,19 +891,23 @@ PwxFileReader::writeRideFile(Context *context, const RideFile *ride, QFile &file sample.appendChild(dist); - // lat - if (ride->areDataPresent()->lat && point->lat > -90.0 && point->lat < 90.0) { - QDomElement lat = doc.createElement("lat"); - text = doc.createTextNode(QString("%1").arg(point->lat, 0, 'g', 11)); - lat.appendChild(text); - sample.appendChild(lat); - } - // lon - if (ride->areDataPresent()->lon && point->lon > -180.00 && point->lon < 180.00) { - QDomElement lon = doc.createElement("lon"); - text = doc.createTextNode(QString("%1").arg(point->lon, 0, 'g', 11)); - lon.appendChild(text); - sample.appendChild(lon); + // lat/lon only if both non-zero and valid. + if (point->lat && point->lon) { + + // lon + if (ride->areDataPresent()->lat && point->lat > -90.0 && point->lat < 90.0) { + QDomElement lat = doc.createElement("lat"); + text = doc.createTextNode(QString("%1").arg(point->lat, 0, 'g', 11)); + lat.appendChild(text); + sample.appendChild(lat); + } + // lon + if (ride->areDataPresent()->lon && point->lon > -180.00 && point->lon < 180.00) { + QDomElement lon = doc.createElement("lon"); + text = doc.createTextNode(QString("%1").arg(point->lon, 0, 'g', 11)); + lon.appendChild(text); + sample.appendChild(lon); + } } // alt