1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-04-20 20:29:10 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
048198dfe1 Removed duplicit map error debug output 2023-03-18 10:11:11 +01:00
a50fa28c08 Properly chceck for GCS/PCS files 2023-03-18 09:51:07 +01:00
3 changed files with 10 additions and 9 deletions

View File

@ -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);
} }

View File

@ -137,11 +137,8 @@ TreeNode<MapAction*> GUI::createMapActionsNode(const TreeNode<Map*> &node)
MapAction *a = new MapAction(map, _mapsActionGroup); MapAction *a = new MapAction(map, _mapsActionGroup);
connect(a, &MapAction::loaded, this, &GUI::mapInitialized); connect(a, &MapAction::loaded, this, &GUI::mapInitialized);
tree.addItem(a); tree.addItem(a);
} else { } else
qWarning("%s: %s", qPrintable(map->path()),
qPrintable(map->errorString()));
delete map; delete map;
}
} }
return tree; return tree;

View File

@ -80,7 +80,6 @@ Map *MapList::loadFile(const QString &path, const Projection &proj, bool *isDir)
errors.append(it.key() + ": " + map->errorString()); errors.append(it.key() + ": " + map->errorString());
++it; ++it;
} }
} else { } else {
for (it = _parsers.begin(); it != _parsers.end(); it++) { for (it = _parsers.begin(); it != _parsers.end(); it++) {
map = it.value()(path, proj, isDir); map = it.value()(path, proj, isDir);