1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-27 11:39:16 +02:00

Fixed HTTP2 settings handling

This commit is contained in:
2018-10-07 14:22:13 +02:00
parent 2f9751672e
commit f9af06267a
4 changed files with 21 additions and 5 deletions

View File

@ -5,6 +5,7 @@
#include <QNetworkProxyFactory>
#include <QNetworkAccessManager>
#include <QLibraryInfo>
#include <QSettings>
#include "map/downloader.h"
#include "map/ellipsoid.h"
#include "map/gcs.h"
@ -12,6 +13,7 @@
#include "opengl.h"
#include "gui.h"
#include "config.h"
#include "settings.h"
#include "app.h"
@ -37,6 +39,16 @@ App::App(int &argc, char **argv) : QApplication(argc, argv),
QNetworkProxyFactory::setUseSystemConfiguration(true);
Downloader::setNetworkAccessManager(new QNetworkAccessManager(this));
QSettings settings(APP_NAME, APP_NAME);
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());
settings.endGroup();
OPENGL_SET_SAMPLES(4);
loadDatums();
loadPCSs();

View File

@ -2085,10 +2085,6 @@ void GUI::readSettings()
_poi->setRadius(_options.poiRadius);
QPixmapCache::setCacheLimit(_options.pixmapCache * 1024);
Downloader::setTimeout(_options.connectionTimeout);
#ifdef ENABLE_HTTP2
Downloader::enableHTTP2(_options.enableHTTP2);
#endif // ENABLE_HTTP2
settings.endGroup();
}