1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

Use standards compliant paths for the tile chache

This commit is contained in:
Martin Tůma 2018-11-07 22:53:27 +01:00
parent efc773d04b
commit a299207e5d
2 changed files with 13 additions and 3 deletions

View File

@ -699,7 +699,9 @@ void GUI::paths()
+ tr("POI directory:") + "</td><td><code>" + tr("POI directory:") + "</td><td><code>"
+ QDir::cleanPath(ProgramPaths::poiDir(true)) + "</code></td></tr><tr><td>" + QDir::cleanPath(ProgramPaths::poiDir(true)) + "</code></td></tr><tr><td>"
+ tr("GCS/PCS directory:") + "</td><td><code>" + tr("GCS/PCS directory:") + "</td><td><code>"
+ QDir::cleanPath(ProgramPaths::csvDir(true)) + "</code></td></tr></table>" + QDir::cleanPath(ProgramPaths::csvDir(true)) + "</code></td></tr><tr><td>"
+ tr("Tile cache directory:") + "</td><td><code>"
+ QDir::cleanPath(ProgramPaths::tilesDir()) + "</code></td></tr></table>"
); );
msgBox.exec(); msgBox.exec();

View File

@ -75,7 +75,15 @@ QString ProgramPaths::csvDir(bool writable)
QString ProgramPaths::tilesDir() QString ProgramPaths::tilesDir()
{ {
return dir(TILES_DIR, true); #if defined(Q_OS_WIN32)
return QDir::homePath() + QString("/AppData/Local/")
+ qApp->applicationName() + QString("/cache");
#elif defined(Q_OS_MAC)
return QDir::homePath() + QString("/Library/Caches/")
+ qApp->applicationName();
#else
return QDir::homePath() + QString("/.cache/") + qApp->applicationName();
#endif
} }
QString ProgramPaths::translationsDir() QString ProgramPaths::translationsDir()
@ -135,7 +143,7 @@ QString ProgramPaths::csvDir(bool writable)
QString ProgramPaths::tilesDir() QString ProgramPaths::tilesDir()
{ {
return QDir(QStandardPaths::writableLocation( return QDir(QStandardPaths::writableLocation(
QStandardPaths::AppLocalDataLocation)).filePath(TILES_DIR); QStandardPaths::CacheLocation)).filePath(TILES_DIR);
} }
QString ProgramPaths::translationsDir() QString ProgramPaths::translationsDir()