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

Use standards compliant paths for the tile chache

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

View File

@ -75,7 +75,15 @@ QString ProgramPaths::csvDir(bool writable)
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()
@ -135,7 +143,7 @@ QString ProgramPaths::csvDir(bool writable)
QString ProgramPaths::tilesDir()
{
return QDir(QStandardPaths::writableLocation(
QStandardPaths::AppLocalDataLocation)).filePath(TILES_DIR);
QStandardPaths::CacheLocation)).filePath(TILES_DIR);
}
QString ProgramPaths::translationsDir()