mapwidgethelper: use system_default_directory() for cache

The default location which is used when the
PluginParemeter "googlemaps.cachefolder" is not specified
should be ~/.cache/googlemaps on Linux or
/user/<name>/appdata/local/cache/googlemaps on Windows.

This patch moves the cache to the default system location
where we store the printing templates, cloudstorage and the
default user XML file.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2017-08-12 18:14:32 +03:00 committed by Dirk Hohndel
parent 1da4f91cc8
commit 12ea31ef78

View file

@ -249,6 +249,7 @@ QString MapWidgetHelper::pluginObject()
str += " id: mapPlugin;";
str += " name: 'googlemaps';";
str += " PluginParameter { name: 'googlemaps.maps.language'; value: '%lang%' }";
str += " PluginParameter { name: 'googlemaps.cachefolder'; value: '%cacheFolder%' }";
str += " Component.onCompleted: {";
str += " if (availableServiceProviders.indexOf(name) === -1) {";
str += " console.warn('MapWidget.qml: cannot find a plugin named: ' + name);";
@ -257,5 +258,7 @@ QString MapWidgetHelper::pluginObject()
str += "}";
QString lang = uiLanguage(NULL).replace('_', '-');
str.replace("%lang%", lang);
QString cacheFolder = QString(system_default_directory()).append("/googlemaps");
str.replace("%cacheFolder%", cacheFolder.replace("\\", "/"));
return str;
}