mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-18 11:52:08 +01:00
Improved error reporting
This commit is contained in:
parent
699e086618
commit
701f392a29
@ -445,7 +445,11 @@ void RasterTile::fetchData(QList<MapData::Poly> &polygons,
|
||||
|
||||
if (dynamic_cast<IMGData*>(_data)) {
|
||||
_file = new QFile(_data->fileName());
|
||||
_file->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||
if (!_file->open(QIODevice::ReadOnly | QIODevice::Unbuffered)) {
|
||||
qWarning("%s: %s", qPrintable(_file->fileName()),
|
||||
qPrintable(_file->errorString()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QRectF polyRect(ttl, QPointF(ttl.x() + _rect.width(), ttl.y()
|
||||
|
@ -26,7 +26,9 @@ public:
|
||||
|
||||
if (!_file) {
|
||||
_file = new QFile(subFile->fileName());
|
||||
_file->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||
if (!_file->open(QIODevice::ReadOnly | QIODevice::Unbuffered))
|
||||
qWarning("%s: %s", qPrintable(_file->fileName()),
|
||||
qPrintable(_file->errorString()));
|
||||
_delete = true;
|
||||
}
|
||||
_data.resize(subFile->blockSize());
|
||||
|
@ -258,7 +258,9 @@ void AQMMap::load(const Projection &in, const Projection &out,
|
||||
Q_UNUSED(out);
|
||||
|
||||
_mapRatio = hidpi ? deviceRatio : 1.0;
|
||||
_file.open(QIODevice::ReadOnly);
|
||||
if (!_file.open(QIODevice::ReadOnly))
|
||||
qWarning("%s: %s", qPrintable(_file.fileName()),
|
||||
qPrintable(_file.errorString()));
|
||||
}
|
||||
|
||||
void AQMMap::unload()
|
||||
|
@ -141,8 +141,7 @@ bool Conversion::loadList(const QString &path)
|
||||
bool res;
|
||||
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
qWarning("Error opening projections file: %s: %s", qPrintable(path),
|
||||
qPrintable(file.errorString()));
|
||||
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,7 @@ bool Ellipsoid::loadList(const QString &path)
|
||||
bool res;
|
||||
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
qWarning("Error opening ellipsoids file: %s: %s", qPrintable(path),
|
||||
qPrintable(file.errorString()));
|
||||
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -102,8 +102,7 @@ bool GCS::loadList(const QString &path)
|
||||
bool res;
|
||||
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
qWarning("Error opening GCS file: %s: %s", qPrintable(path),
|
||||
qPrintable(file.errorString()));
|
||||
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,9 @@ void GEMFMap::load(const Projection &in, const Projection &out,
|
||||
Q_UNUSED(out);
|
||||
|
||||
_mapRatio = hidpi ? deviceRatio : 1.0;
|
||||
_file.open(QIODevice::ReadOnly);
|
||||
if (!_file.open(QIODevice::ReadOnly))
|
||||
qWarning("%s: %s", qPrintable(_file.fileName()),
|
||||
qPrintable(_file.errorString()));
|
||||
}
|
||||
|
||||
void GEMFMap::unload()
|
||||
|
@ -162,7 +162,10 @@ void JNXMap::load(const Projection &in, const Projection &out,
|
||||
_projection = in;
|
||||
_mapRatio = hidpi ? deviceRatio : 1.0;
|
||||
|
||||
if (_file.open(QIODevice::ReadOnly))
|
||||
if (!_file.open(QIODevice::ReadOnly))
|
||||
qWarning("%s: %s", qPrintable(_file.fileName()),
|
||||
qPrintable(_file.errorString()));
|
||||
else
|
||||
readTiles();
|
||||
}
|
||||
|
||||
|
@ -459,7 +459,11 @@ RectC MapData::bounds() const
|
||||
void MapData::load()
|
||||
{
|
||||
QFile file(_fileName);
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Unbuffered))
|
||||
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Unbuffered))
|
||||
qWarning("%s: %s", qPrintable(file.fileName()),
|
||||
qPrintable(file.errorString()));
|
||||
else
|
||||
readSubFiles(file);
|
||||
}
|
||||
|
||||
|
@ -410,8 +410,11 @@ void RasterTile::fetchData(QList<MapData::Path> &paths,
|
||||
QPoint ttl(_rect.topLeft());
|
||||
QFile file(_data->fileName());
|
||||
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Unbuffered))
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Unbuffered)) {
|
||||
qWarning("%s: %s", qPrintable(file.fileName()),
|
||||
qPrintable(file.errorString()));
|
||||
return;
|
||||
}
|
||||
|
||||
QRectF pathRect(QPointF(ttl.x() - PATHS_EXTENT, ttl.y() - PATHS_EXTENT),
|
||||
QPointF(ttl.x() + _rect.width() + PATHS_EXTENT, ttl.y() + _rect.height()
|
||||
|
@ -31,8 +31,7 @@ bool PCS::loadList(const QString &path)
|
||||
bool res;
|
||||
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
qWarning("Error opening PCS file: %s: %s", qPrintable(path),
|
||||
qPrintable(file.errorString()));
|
||||
qWarning("%s: %s", qPrintable(path), qPrintable(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -361,7 +361,9 @@ void QCTMap::load(const Projection &in, const Projection &out,
|
||||
Q_UNUSED(out);
|
||||
|
||||
_mapRatio = hidpi ? deviceRatio : 1.0;
|
||||
_file.open(QIODevice::ReadOnly);
|
||||
if (!_file.open(QIODevice::ReadOnly))
|
||||
qWarning("%s: %s", qPrintable(_file.fileName()),
|
||||
qPrintable(_file.errorString()));
|
||||
}
|
||||
|
||||
void QCTMap::unload()
|
||||
|
@ -365,7 +365,9 @@ void RMap::load(const Projection &in, const Projection &out, qreal deviceRatio,
|
||||
Q_UNUSED(out);
|
||||
|
||||
_mapRatio = hidpi ? deviceRatio : 1.0;
|
||||
_file.open(QIODevice::ReadOnly);
|
||||
if (!_file.open(QIODevice::ReadOnly))
|
||||
qWarning("%s: %s", qPrintable(_file.fileName()),
|
||||
qPrintable(_file.errorString()));
|
||||
}
|
||||
|
||||
void RMap::unload()
|
||||
|
Loading…
x
Reference in New Issue
Block a user