Commit 60d9183a authored by Volker Krause's avatar Volker Krause
Browse files

Add a way to clear the OSM tile cache

Useful for debugging tile download or backend issues.
parent e32977df
......@@ -44,6 +44,11 @@ Kirigami.ScrollablePage {
Layout.fillWidth: true
onClicked: DevelopmentModeController.purgeMapCSS();
}
QQC2.Button {
text: "Clear OSM Tile Cache"
Layout.fillWidth: true
onClicked: DevelopmentModeController.clearOsmTileCache();
}
QQC2.Button {
text: "Enable KPT Logging"
......
......@@ -71,3 +71,16 @@ void DevelopmentModeController::purgeMapCSS()
path += QLatin1String("/org.kde.kosmindoormap/assets/css/");
QDir(path).removeRecursively();
}
void DevelopmentModeController::clearOsmTileCache()
{
// see KOSMIndoorMap::TileCache
QString base;
if (!qEnvironmentVariableIsSet("KOSMINDOORMAP_CACHE_PATH")) {
base = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation)
+ QLatin1String("/org.kde.osm/vectorosm");
} else {
base = qEnvironmentVariable("KOSMINDOORMAP_CACHE_PATH");
}
QDir(base + QLatin1String("/17")).removeRecursively();
}
......@@ -18,6 +18,7 @@ public:
Q_INVOKABLE void enablePublicTransportLogging();
Q_INVOKABLE void importMapCSS(const QUrl &url);
Q_INVOKABLE void purgeMapCSS();
Q_INVOKABLE void clearOsmTileCache();
};
Q_DECLARE_METATYPE(DevelopmentModeController)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment