mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Improved error reporting
This commit is contained in:
parent
e13d6dfc4b
commit
2541797e7d
@ -52,8 +52,10 @@ bool GMAPData::readXML(const QString &path, QString &dataDir, QString &typFile)
|
|||||||
{
|
{
|
||||||
QFile file(path);
|
QFile file(path);
|
||||||
|
|
||||||
if (!file.open(QFile::ReadOnly | QFile::Text))
|
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||||
|
_errorString = file.errorString();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QXmlStreamReader reader(&file);
|
QXmlStreamReader reader(&file);
|
||||||
if (reader.readNextStartElement()) {
|
if (reader.readNextStartElement()) {
|
||||||
|
@ -395,7 +395,7 @@ BSBMap::BSBMap(const QString &fileName, QObject *parent)
|
|||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
|
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
_errorString = fileName + ": " + file.errorString();
|
_errorString = file.errorString();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,8 +366,10 @@ bool OruxMap::readXML(const QString &path, const QString &dir)
|
|||||||
{
|
{
|
||||||
QFile file(path);
|
QFile file(path);
|
||||||
|
|
||||||
if (!file.open(QFile::ReadOnly | QFile::Text))
|
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||||
|
_errorString = file.errorString();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QXmlStreamReader reader(&file);
|
QXmlStreamReader reader(&file);
|
||||||
if (reader.readNextStartElement()) {
|
if (reader.readNextStartElement()) {
|
||||||
|
@ -327,7 +327,7 @@ QCTMap::QCTMap(const QString &fileName, QObject *parent)
|
|||||||
_mapRatio(1.0), _valid(false)
|
_mapRatio(1.0), _valid(false)
|
||||||
{
|
{
|
||||||
if (!_file.open(QIODevice::ReadOnly)) {
|
if (!_file.open(QIODevice::ReadOnly)) {
|
||||||
_errorString = fileName + ": " + _file.errorString();
|
_errorString = _file.errorString();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user