Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Itinerary
Commits
60d9183a
Commit
60d9183a
authored
Nov 21, 2020
by
Volker Krause
Browse files
Add a way to clear the OSM tile cache
Useful for debugging tile download or backend issues.
parent
e32977df
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/app/DevelopmentModePage.qml
View file @
60d9183a
...
...
@@ -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
"
...
...
src/app/developmentmodecontroller.cpp
View file @
60d9183a
...
...
@@ -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
();
}
src/app/developmentmodecontroller.h
View file @
60d9183a
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment