From b54aeff3690b4fbbb054b70631262a5c70d7f19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 13 Oct 2017 18:15:37 +0200 Subject: [PATCH] Fixed copy&paste error, code cleanup --- src/kmlparser.cpp | 19 ++++--------------- src/kmlparser.h | 1 - 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/kmlparser.cpp b/src/kmlparser.cpp index 7f7d8ff8..5de43524 100644 --- a/src/kmlparser.cpp +++ b/src/kmlparser.cpp @@ -225,17 +225,6 @@ void KMLParser::point(Waypoint &waypoint) _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) { int i = start; @@ -244,7 +233,7 @@ void KMLParser::heartRate(TrackData &track, int start) while (_reader.readNextStartElement()) { if (_reader.name() == "value") { if (i < track.size()) - track[i++].setCadence(value()); + track[i++].setHeartRate(number()); else { _reader.raiseError(error); return; @@ -265,7 +254,7 @@ void KMLParser::cadence(TrackData &track, int start) while (_reader.readNextStartElement()) { if (_reader.name() == "value") { if (i < track.size()) - track[i++].setCadence(value()); + track[i++].setCadence(number()); else { _reader.raiseError(error); return; @@ -286,7 +275,7 @@ void KMLParser::speed(TrackData &track, int start) while (_reader.readNextStartElement()) { if (_reader.name() == "value") { if (i < track.size()) - track[i++].setSpeed(value()); + track[i++].setSpeed(number()); else { _reader.raiseError(error); return; @@ -307,7 +296,7 @@ void KMLParser::temperature(TrackData &track, int start) while (_reader.readNextStartElement()) { if (_reader.name() == "value") { if (i < track.size()) - track[i++].setTemperature(value()); + track[i++].setTemperature(number()); else { _reader.raiseError(error); return; diff --git a/src/kmlparser.h b/src/kmlparser.h index ed5b847e..6aa9785b 100644 --- a/src/kmlparser.h +++ b/src/kmlparser.h @@ -35,7 +35,6 @@ private: void cadence(TrackData &track, int start); void speed(TrackData &track, int start); void temperature(TrackData &track, int start); - qreal value(); QDateTime timeStamp(); qreal number(); QDateTime time();