1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Code cleanup

This commit is contained in:
Martin Tůma 2019-03-21 23:45:04 +01:00
parent 241ecb36f2
commit 5b83f1b86b
2 changed files with 13 additions and 8 deletions

View File

@ -14,4 +14,8 @@
#define ENABLE_HIDPI
#endif // QT >= 5.6
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#define ENABLE_GEOJSON
#endif // QT >= 5.0
#endif /* CONFIG_H */

View File

@ -2,6 +2,7 @@
#include <QFile>
#include <QFileInfo>
#include <QLineF>
#include "common/config.h"
#include "gpxparser.h"
#include "tcxparser.h"
#include "csvparser.h"
@ -12,9 +13,9 @@
#include "oziparsers.h"
#include "locparser.h"
#include "slfparser.h"
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#ifdef ENABLE_GEOJSON
#include "geojsonparser.h"
#endif // QT 5
#endif // ENABLE_GEOJSON
#include "exifparser.h"
#include "dem.h"
#include "data.h"
@ -32,9 +33,9 @@ static WPTParser wpt;
static RTEParser rte;
static LOCParser loc;
static SLFParser slf;
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#ifdef ENABLE_GEOJSON
static GeoJSONParser geojson;
#endif // QT 5
#endif // ENABLE_GEOJSON
static EXIFParser exif;
static QHash<QString, Parser*> parsers()
@ -53,10 +54,10 @@ static QHash<QString, Parser*> parsers()
hash.insert("rte", &rte);
hash.insert("loc", &loc);
hash.insert("slf", &slf);
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#ifdef ENABLE_GEOJSON
hash.insert("json", &geojson);
hash.insert("geojson", &geojson);
#endif // QT 5
#endif // ENABLE_GEOJSON
hash.insert("jpeg", &exif);
hash.insert("jpg", &exif);
@ -147,9 +148,9 @@ QString Data::formats()
qApp->translate("Data", "Supported files") + " (" + supported + ");;"
+ qApp->translate("Data", "CSV files") + " (*.csv);;"
+ qApp->translate("Data", "FIT files") + " (*.fit);;"
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#ifdef ENABLE_GEOJSON
+ qApp->translate("Data", "GeoJSON files") + " (*.geojson *.json);;"
#endif // QT5
#endif // ENABLE_GEOJSON
+ qApp->translate("Data", "GPX files") + " (*.gpx);;"
+ qApp->translate("Data", "IGC files") + " (*.igc);;"
+ qApp->translate("Data", "JPEG images") + " (*.jpg *.jpeg);;"