1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-02-26 04:00:49 +01:00

Code cleanup

This commit is contained in:
Martin Tůma 2023-01-31 19:21:14 +01:00
parent 78b091fbbc
commit 505f01a990
2 changed files with 8 additions and 5 deletions

View File

@ -2,12 +2,16 @@
#define SETTINGS_H #define SETTINGS_H
#include <QtGlobal> #include <QtGlobal>
#include "common/config.h"
#define IMPERIAL_UNITS() \ #define IMPERIAL_UNITS() \
(QLocale::system().measurementSystem() == QLocale::ImperialSystem) (QLocale::system().measurementSystem() == QLocale::ImperialSystem)
#define POSITION_PLUGIN() \ #define POSITION_PLUGIN() \
(QGeoPositionInfoSource::availableSources().isEmpty() \ (QGeoPositionInfoSource::availableSources().isEmpty() \
? "" : QGeoPositionInfoSource::availableSources().first()) ? "" : QGeoPositionInfoSource::availableSources().first())
#define CURRENT_PATH(filename) \
QString("%1/" filename).arg(QDir::currentPath())
#define WINDOW_SETTINGS_GROUP "Window" #define WINDOW_SETTINGS_GROUP "Window"
#define WINDOW_GEOMETRY_SETTING "geometry" #define WINDOW_GEOMETRY_SETTING "geometry"
@ -105,8 +109,7 @@
#define PDF_MARGIN_BOTTOM_SETTING "marginBottom" #define PDF_MARGIN_BOTTOM_SETTING "marginBottom"
#define PDF_MARGIN_BOTTOM_DEFAULT 5 /* mm */ #define PDF_MARGIN_BOTTOM_DEFAULT 5 /* mm */
#define PDF_FILENAME_SETTING "fileName" #define PDF_FILENAME_SETTING "fileName"
#define PDF_FILENAME_DEFAULT QString("%1/export.pdf"). \ #define PDF_FILENAME_DEFAULT CURRENT_PATH("export.pdf")
arg(QDir::currentPath())
#define RESOLUTION_SETTING "resolution" #define RESOLUTION_SETTING "resolution"
#define RESOLUTION_DEFAULT 600 #define RESOLUTION_DEFAULT 600
@ -126,8 +129,7 @@
#define PNG_ANTIALIASING_SETTING "antialiasing" #define PNG_ANTIALIASING_SETTING "antialiasing"
#define PNG_ANTIALIASING_DEFAULT true #define PNG_ANTIALIASING_DEFAULT true
#define PNG_FILENAME_SETTING "fileName" #define PNG_FILENAME_SETTING "fileName"
#define PNG_FILENAME_DEFAULT QString("%1/export.png"). \ #define PNG_FILENAME_DEFAULT CURRENT_PATH("export.png")
arg(QDir::currentPath())
#define OPTIONS_SETTINGS_GROUP "Options" #define OPTIONS_SETTINGS_GROUP "Options"
#define PALETTE_COLOR_SETTING "paletteColor" #define PALETTE_COLOR_SETTING "paletteColor"
@ -204,7 +206,7 @@
#define POI_RADIUS_SETTING "poiRadius" #define POI_RADIUS_SETTING "poiRadius"
#define POI_RADIUS_DEFAULT (int)(IMPERIAL_UNITS() ? MIINM : KMINM) #define POI_RADIUS_DEFAULT (int)(IMPERIAL_UNITS() ? MIINM : KMINM)
#define DEM_URL_SETTING "demURL" #define DEM_URL_SETTING "demURL"
#define DEM_URL_DEFAULT "http://dem.gpxsee.org/$lat/$lat$lon.hgt.zip" #define DEM_URL_DEFAULT DEM_TILES_URL
#define DEM_AUTH_SETTING "demAuthentication" #define DEM_AUTH_SETTING "demAuthentication"
#define DEM_AUTH_DEFAULT false #define DEM_AUTH_DEFAULT false
#define DEM_USERNAME_SETTING "demUsername" #define DEM_USERNAME_SETTING "demUsername"

View File

@ -3,5 +3,6 @@
#define APP_NAME "GPXSee" #define APP_NAME "GPXSee"
#define APP_HOMEPAGE "http://www.gpxsee.org" #define APP_HOMEPAGE "http://www.gpxsee.org"
#define DEM_TILES_URL "http://dem.gpxsee.org/$lat/$lat$lon.hgt.zip"
#endif /* CONFIG_H */ #endif /* CONFIG_H */