1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-19 12:12:08 +01:00

Fixed build with older Qt versions

This commit is contained in:
Martin Tůma 2023-03-01 00:23:01 +01:00
parent 7be3a27196
commit 267094dc6c
3 changed files with 8 additions and 3 deletions

View File

@ -56,6 +56,7 @@ App::App(int &argc, char **argv) : QApplication(argc, argv)
"QThreadStorage: Thread X exited after QThreadStorage Y destroyed" */ "QThreadStorage: Thread X exited after QThreadStorage Y destroyed" */
Downloader::setNetworkManager(new QNetworkAccessManager(this)); Downloader::setNetworkManager(new QNetworkAccessManager(this));
DEM::setDir(ProgramPaths::demDir()); DEM::setDir(ProgramPaths::demDir());
DEM::setCacheSize(536870912/*512MB*/);
QSurfaceFormat fmt; QSurfaceFormat fmt;
fmt.setStencilBufferSize(8); fmt.setStencilBufferSize(8);
fmt.setSamples(4); fmt.setSamples(4);

View File

@ -21,8 +21,6 @@
#include "common/rectc.h" #include "common/rectc.h"
#include "dem.h" #include "dem.h"
#define CACHE_SIZE 536870912 /* 512MB */
#define SRTM3_SAMPLES 1201 #define SRTM3_SAMPLES 1201
#define SRTM1_SAMPLES 3601 #define SRTM1_SAMPLES 3601
#define SRTM05_SAMPLES 7201 #define SRTM05_SAMPLES 7201
@ -89,13 +87,18 @@ QString DEM::Tile::baseName() const
} }
QString DEM::_dir; QString DEM::_dir;
DEM::TileCache DEM::_data = DEM::TileCache(CACHE_SIZE); DEM::TileCache DEM::_data;
QString DEM::fileName(const QString &baseName) QString DEM::fileName(const QString &baseName)
{ {
return QDir(_dir).absoluteFilePath(baseName); return QDir(_dir).absoluteFilePath(baseName);
} }
void DEM::setCacheSize(int size)
{
_data.setMaxCost(size);
}
void DEM::setDir(const QString &path) void DEM::setDir(const QString &path)
{ {
_dir = path; _dir = path;

View File

@ -34,6 +34,7 @@ public:
int _lon, _lat; int _lon, _lat;
}; };
static void setCacheSize(int size);
static void setDir(const QString &path); static void setDir(const QString &path);
static void clearCache(); static void clearCache();
static qreal elevation(const Coordinates &c); static qreal elevation(const Coordinates &c);