From 4fb0bfefc2ccd0d5ac241f407e20efd1c4b47ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Mon, 21 Jan 2019 23:40:29 +0100 Subject: [PATCH] Apply DEM settings to POI loading on startup --- src/GUI/app.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/GUI/app.cpp b/src/GUI/app.cpp index d9c20b4c..b3f5430c 100644 --- a/src/GUI/app.cpp +++ b/src/GUI/app.cpp @@ -13,6 +13,7 @@ #include "map/gcs.h" #include "map/pcs.h" #include "data/dem.h" +#include "data/data.h" #include "opengl.h" #include "gui.h" #include "settings.h" @@ -45,28 +46,29 @@ App::App(int &argc, char **argv) : QApplication(argc, argv) #ifdef Q_OS_MAC setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Q_OS_MAC - QNetworkProxyFactory::setUseSystemConfiguration(true); - QSettings settings(APP_NAME, APP_NAME); - settings.beginGroup(OPTIONS_SETTINGS_GROUP); - /* The QNetworkAccessManager must be a child of QApplication, otherwise it triggers the following warning on exit (and may probably crash): "QThreadStorage: Thread X exited after QThreadStorage Y destroyed" */ Downloader::setNetworkManager(new QNetworkAccessManager(this)); + DEM::setDir(ProgramPaths::demDir()); + OPENGL_SET_SAMPLES(4); + + loadDatums(); + loadPCSs(); + + QSettings settings(qApp->applicationName(), qApp->applicationName()); + settings.beginGroup(OPTIONS_SETTINGS_GROUP); #ifdef ENABLE_HTTP2 Downloader::enableHTTP2(settings.value(ENABLE_HTTP2_SETTING, ENABLE_HTTP2_DEFAULT).toBool()); #endif // ENABLE_HTTP2 Downloader::setTimeout(settings.value(CONNECTION_TIMEOUT_SETTING, CONNECTION_TIMEOUT_DEFAULT).toInt()); + Data::useDEMElevation(settings.value(USE_DEM_ELEVATION_SETTING, + USE_DEM_ELEVATION_DEFAULT).toBool()); settings.endGroup(); - OPENGL_SET_SAMPLES(4); - loadDatums(); - loadPCSs(); - DEM::setDir(ProgramPaths::demDir()); - _gui = new GUI(); }