mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 17:15:14 +01:00
Properly chceck for GCS/PCS files
This commit is contained in:
parent
152f17f15a
commit
a50fa28c08
@ -7,6 +7,7 @@
|
|||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
#include <QSurfaceFormat>
|
#include <QSurfaceFormat>
|
||||||
#include <QImageReader>
|
#include <QImageReader>
|
||||||
|
#include <QFileInfo>
|
||||||
#ifdef Q_OS_ANDROID
|
#ifdef Q_OS_ANDROID
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QJniObject>
|
#include <QJniObject>
|
||||||
@ -154,10 +155,13 @@ void App::loadDatums()
|
|||||||
QString ellipsoidsFile(ProgramPaths::ellipsoidsFile());
|
QString ellipsoidsFile(ProgramPaths::ellipsoidsFile());
|
||||||
QString gcsFile(ProgramPaths::gcsFile());
|
QString gcsFile(ProgramPaths::gcsFile());
|
||||||
|
|
||||||
if (ellipsoidsFile.isNull())
|
if (!QFileInfo::exists(ellipsoidsFile)) {
|
||||||
qWarning("No ellipsoids file found.");
|
qWarning("No ellipsoids file found.");
|
||||||
if (gcsFile.isNull())
|
ellipsoidsFile = QString();
|
||||||
|
} if (!QFileInfo::exists(gcsFile)) {
|
||||||
qWarning("No GCS file found.");
|
qWarning("No GCS file found.");
|
||||||
|
gcsFile = QString();
|
||||||
|
}
|
||||||
|
|
||||||
if (!ellipsoidsFile.isNull() && !gcsFile.isNull()) {
|
if (!ellipsoidsFile.isNull() && !gcsFile.isNull()) {
|
||||||
Ellipsoid::loadList(ellipsoidsFile);
|
Ellipsoid::loadList(ellipsoidsFile);
|
||||||
@ -170,8 +174,9 @@ void App::loadPCSs()
|
|||||||
{
|
{
|
||||||
QString pcsFile(ProgramPaths::pcsFile());
|
QString pcsFile(ProgramPaths::pcsFile());
|
||||||
|
|
||||||
if (pcsFile.isNull())
|
if (!QFileInfo::exists(pcsFile)) {
|
||||||
qWarning("No PCS file found.");
|
qWarning("No PCS file found.");
|
||||||
else
|
qWarning("Maps based on a projection different from EPSG:3857 won't work.");
|
||||||
|
} else
|
||||||
PCS::loadList(pcsFile);
|
PCS::loadList(pcsFile);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user