1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-30 22:51:16 +01:00

Improved error reporting

This commit is contained in:
Martin Tůma 2018-01-21 11:17:32 +01:00
parent 02e724fefb
commit fda33cc95b

View File

@ -161,6 +161,20 @@ void PCS::loadList(const QString &path)
continue;
}
if (LinearUnits(units).isNull()) {
qWarning("%s: %d: Unknown linear units code", qPrintable(path), ln);
continue;
}
if (Projection::Method(transform).isNull()) {
qWarning("%s: %d: Unknown coordinate transformation code",
qPrintable(path), ln);
continue;
}
if (!(gcs = GCS::gcs(gcsid))) {
qWarning("%s: %d: Unknown GCS code", qPrintable(path), ln);
continue;
}
Projection::Setup setup;
if ((pn = projectionSetup(list, setup))) {
qWarning("%s: %d: Invalid projection parameter #%d",
@ -168,17 +182,8 @@ void PCS::loadList(const QString &path)
continue;
}
if (!(gcs = GCS::gcs(gcsid))) {
qWarning("%s: %d: Unknown GCS code", qPrintable(path), ln);
continue;
}
PCS pcs(gcs, transform, setup, units);
if (!pcs.isValid())
qWarning("%s: %d: Unknown coordinate transformation/linear units code",
qPrintable(path), ln);
else
_pcss.append(Entry(id, proj, pcs));
_pcss.append(Entry(id, proj, pcs));
}
}
@ -186,5 +191,5 @@ QDebug operator<<(QDebug dbg, const PCS &pcs)
{
dbg.nospace() << "PCS(" << *pcs.gcs() << ", " << pcs.method() << ", "
<< pcs.units() << ", " << pcs.setup() << ")";
return dbg.maybeSpace();
return dbg.space();
}