mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
29 lines
462 B
C++
29 lines
462 B
C++
#include <QFile>
|
|
#include <QLineF>
|
|
#include "ll.h"
|
|
#include "gpx.h"
|
|
|
|
|
|
bool GPX::loadFile(const QString &fileName)
|
|
{
|
|
QFile file(fileName);
|
|
bool ret;
|
|
|
|
_tracks.clear();
|
|
_error.clear();
|
|
_errorLine = 0;
|
|
|
|
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
|
_error = qPrintable(file.errorString());
|
|
return false;
|
|
}
|
|
|
|
if (!(ret = _parser.loadFile(&file))) {
|
|
_error = _parser.errorString();
|
|
_errorLine = _parser.errorLine();
|
|
}
|
|
file.close();
|
|
|
|
return ret;
|
|
}
|