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

Added support for user defined TYP files for Garmin IMG maps

This commit is contained in:
2019-05-16 20:23:37 +02:00
parent 3747ae6afc
commit 785bf94a01
8 changed files with 102 additions and 31 deletions

View File

@ -9,9 +9,11 @@
#define DEM_DIR "DEM"
#define TILES_DIR "tiles"
#define TRANSLATIONS_DIR "translations"
#define STYLE_DIR "style"
#define ELLIPSOID_FILE "ellipsoids.csv"
#define GCS_FILE "gcs.csv"
#define PCS_FILE "pcs.csv"
#define TYP_FILE "style.typ"
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
@ -79,6 +81,11 @@ QString ProgramPaths::demDir(bool writable)
return dir(DEM_DIR, writable);
}
QString ProgramPaths::styleDir(bool writable)
{
return dir(STYLE_DIR, writable);
}
QString ProgramPaths::tilesDir()
{
#if defined(Q_OS_WIN32)
@ -113,6 +120,11 @@ QString ProgramPaths::pcsFile()
return file(dir(CSV_DIR), PCS_FILE);
}
QString ProgramPaths::typFile()
{
return file(dir(STYLE_DIR), TYP_FILE);
}
#else // QT_VERSION < 5
#include <QStandardPaths>
@ -157,6 +169,16 @@ QString ProgramPaths::demDir(bool writable)
DEM_DIR, QStandardPaths::LocateDirectory);
}
QString ProgramPaths::styleDir(bool writable)
{
if (writable)
return QDir(QStandardPaths::writableLocation(
QStandardPaths::AppDataLocation)).filePath(STYLE_DIR);
else
return QStandardPaths::locate(QStandardPaths::AppDataLocation,
STYLE_DIR, QStandardPaths::LocateDirectory);
}
QString ProgramPaths::tilesDir()
{
return QDir(QStandardPaths::writableLocation(
@ -187,4 +209,10 @@ QString ProgramPaths::pcsFile()
CSV_DIR "/" PCS_FILE, QStandardPaths::LocateFile);
}
QString ProgramPaths::typFile()
{
return QStandardPaths::locate(QStandardPaths::AppDataLocation,
STYLE_DIR "/" TYP_FILE, QStandardPaths::LocateFile);
}
#endif // QT_VERSION < 5

View File

@ -9,11 +9,13 @@ namespace ProgramPaths
QString poiDir(bool writable = false);
QString csvDir(bool writable = false);
QString demDir(bool writable = false);
QString styleDir(bool writable = false);
QString tilesDir();
QString translationsDir();
QString ellipsoidsFile();
QString gcsFile();
QString pcsFile();
QString typFile();
}
#endif // PROGRAMPATHS_H