mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Fixed copy&paste error, code cleanup
This commit is contained in:
parent
72968efeef
commit
b54aeff369
@ -225,17 +225,6 @@ void KMLParser::point(Waypoint &waypoint)
|
|||||||
_reader.raiseError("Missing Point coordinates");
|
_reader.raiseError("Missing Point coordinates");
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal KMLParser::value()
|
|
||||||
{
|
|
||||||
bool res;
|
|
||||||
qreal val = _reader.readElementText().toDouble(&res);
|
|
||||||
|
|
||||||
if (!res)
|
|
||||||
_reader.raiseError("Invalid value");
|
|
||||||
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
void KMLParser::heartRate(TrackData &track, int start)
|
void KMLParser::heartRate(TrackData &track, int start)
|
||||||
{
|
{
|
||||||
int i = start;
|
int i = start;
|
||||||
@ -244,7 +233,7 @@ void KMLParser::heartRate(TrackData &track, int start)
|
|||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "value") {
|
if (_reader.name() == "value") {
|
||||||
if (i < track.size())
|
if (i < track.size())
|
||||||
track[i++].setCadence(value());
|
track[i++].setHeartRate(number());
|
||||||
else {
|
else {
|
||||||
_reader.raiseError(error);
|
_reader.raiseError(error);
|
||||||
return;
|
return;
|
||||||
@ -265,7 +254,7 @@ void KMLParser::cadence(TrackData &track, int start)
|
|||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "value") {
|
if (_reader.name() == "value") {
|
||||||
if (i < track.size())
|
if (i < track.size())
|
||||||
track[i++].setCadence(value());
|
track[i++].setCadence(number());
|
||||||
else {
|
else {
|
||||||
_reader.raiseError(error);
|
_reader.raiseError(error);
|
||||||
return;
|
return;
|
||||||
@ -286,7 +275,7 @@ void KMLParser::speed(TrackData &track, int start)
|
|||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "value") {
|
if (_reader.name() == "value") {
|
||||||
if (i < track.size())
|
if (i < track.size())
|
||||||
track[i++].setSpeed(value());
|
track[i++].setSpeed(number());
|
||||||
else {
|
else {
|
||||||
_reader.raiseError(error);
|
_reader.raiseError(error);
|
||||||
return;
|
return;
|
||||||
@ -307,7 +296,7 @@ void KMLParser::temperature(TrackData &track, int start)
|
|||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "value") {
|
if (_reader.name() == "value") {
|
||||||
if (i < track.size())
|
if (i < track.size())
|
||||||
track[i++].setTemperature(value());
|
track[i++].setTemperature(number());
|
||||||
else {
|
else {
|
||||||
_reader.raiseError(error);
|
_reader.raiseError(error);
|
||||||
return;
|
return;
|
||||||
|
@ -35,7 +35,6 @@ private:
|
|||||||
void cadence(TrackData &track, int start);
|
void cadence(TrackData &track, int start);
|
||||||
void speed(TrackData &track, int start);
|
void speed(TrackData &track, int start);
|
||||||
void temperature(TrackData &track, int start);
|
void temperature(TrackData &track, int start);
|
||||||
qreal value();
|
|
||||||
QDateTime timeStamp();
|
QDateTime timeStamp();
|
||||||
qreal number();
|
qreal number();
|
||||||
QDateTime time();
|
QDateTime time();
|
||||||
|
Loading…
Reference in New Issue
Block a user