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

Improved error handling

Added file filters to open dialogs
This commit is contained in:
2016-02-12 20:12:37 +01:00
parent 580289e533
commit 932f817496
8 changed files with 149 additions and 120 deletions

View File

@ -10,14 +10,31 @@
bool POI::loadFile(const QString &fileName)
{
QString error;
int errorLine;
_error.clear();
_errorLine = 0;
if (loadCSVFile(fileName))
return true;
else {
error = _error;
errorLine = _errorLine;
}
if (loadGPXFile(fileName))
return true;
fprintf(stderr, "Error loading POI file: %s:\n", qPrintable(fileName));
fprintf(stderr, "CSV: line %d: %s\n", errorLine, qPrintable(error));
fprintf(stderr, "GPX: line %d: %s\n", _errorLine, qPrintable(_error));
if (errorLine > _errorLine) {
_errorLine = errorLine;
_error = error;
}
return false;
}