1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Report an error on HiDPI maps when HiDPI support is not enabled

This commit is contained in:
Martin Tůma 2018-08-20 18:46:44 +02:00
parent 9fe10f10b8
commit f376f7139b

View File

@ -1,5 +1,6 @@
#include <QFile>
#include <QXmlStreamReader>
#include "config.h"
#include "onlinemap.h"
#include "wmtsmap.h"
#include "wmsmap.h"
@ -160,12 +161,16 @@ void MapSource::map(QXmlStreamReader &reader, Config &config)
attr.value("password").toString());
reader.skipCurrentElement();
} else if (reader.name() == "tilePixelRatio") {
#ifdef ENABLE_HIDPI
bool res;
qreal val = reader.readElementText().toDouble(&res);
if (!res)
reader.raiseError("Invalid tilePixelRatio");
else
config.tileRatio = val;
#else // ENABLE_HIDPI
reader.raiseError("HiDPI maps not supported");
#endif // ENABLE_HIDPI
} else
reader.skipCurrentElement();
}