mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
googlemaps: clear the cache folder on language change
Open the cache folder via QDir and call removeRecursively().
At that point the user needs to restart Subsurface to be able to
use the map in another language properly.
This change is triggered by the fact that the user might want to see
the street map in his preferred language after he/she picks another
language from Settings. But one problem here is that the cached files
do not carry a language flag - e.g. they are in the lines of:
googlemaps_100-1-9-445-245.png
Which means that the only way to not mix tiles in different languages
is to clear the cache and start downloading the new tiles in the newly
picked language after Subsurface has restarted.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
9a2d503d3b
commit
a7d8e0d187
1 changed files with 4 additions and 0 deletions
|
|
@ -51,6 +51,10 @@ void PreferencesLanguage::syncSettings()
|
|||
|
||||
if (useSystemLang != ui->languageSystemDefault->isChecked() ||
|
||||
(!useSystemLang && currentText != prefs.locale.language)) {
|
||||
// remove the marble cache folder on language change
|
||||
QDir googlecachedir(QString(system_default_directory()).append("/googlemaps"));
|
||||
googlecachedir.removeRecursively();
|
||||
|
||||
QMessageBox::warning(this, tr("Restart required"),
|
||||
tr("To correctly load a new language you must restart Subsurface."));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue