1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-13 10:25:10 +02:00

Improved error reporting

This commit is contained in:
2016-10-29 12:22:28 +02:00
parent e4d777bace
commit c89f8dbb47
6 changed files with 85 additions and 79 deletions

View File

@ -12,20 +12,20 @@ bool CSVParser::loadFile(QFile *file)
QByteArray line = file->readLine();
QList<QByteArray> list = line.split(',');
if (list.size() < 3) {
_errorString = "Parse error.";
_errorString = "Parse error";
_errorLine = ln;
return false;
}
qreal lat = list[0].trimmed().toDouble(&res);
if (!res || (lat < -90.0 || lat > 90.0)) {
_errorString = "Invalid latitude.";
_errorString = "Invalid latitude";
_errorLine = ln;
return false;
}
qreal lon = list[1].trimmed().toDouble(&res);
if (!res || (lon < -180.0 || lon > 180.0)) {
_errorString = "Invalid longitude.";
_errorString = "Invalid longitude";
_errorLine = ln;
return false;
}