From db7ce408275299e1d446a13181691efbc5ab39ce Mon Sep 17 00:00:00 2001 From: Jeremie Guichard Date: Fri, 6 Apr 2018 09:24:51 +0200 Subject: [PATCH] Fix map tile cache not working on windows for non ASCII cachefolder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This issue was found using the plugin in Subsurface There cachefolder is configured to use path to current user's AppData In my case the user name contains non ASCII char (é) The call to 'toLatin1' trans-coded the char that was then badly interpreted by QString assignment operator. See http://doc.qt.io/qt-5/qstring.html#operator-eq-5 'The byte array is converted to Unicode using the fromUtf8() function.' It resulted in Qt not being able to create the cached files: 'QIODevice::write (QFile, "C:\Users\J?r?mie\AppData\Roaming\ 'Subsurface\googlemaps\googlemaps_100-2-12-2046-1362.jpeg"): ' 'device not open' Signed-off-by: Jeremie Guichard --- qgeotiledmappingmanagerenginegooglemaps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qgeotiledmappingmanagerenginegooglemaps.cpp b/qgeotiledmappingmanagerenginegooglemaps.cpp index 41f9d76..800950a 100644 --- a/qgeotiledmappingmanagerenginegooglemaps.cpp +++ b/qgeotiledmappingmanagerenginegooglemaps.cpp @@ -62,7 +62,7 @@ QGeoTiledMappingManagerEngineGooglemaps::QGeoTiledMappingManagerEngineGooglemaps setTileFetcher(fetcher); if (parameters.contains(QStringLiteral("googlemaps.cachefolder"))) - m_cacheDirectory = parameters.value(QStringLiteral("googlemaps.cachefolder")).toString().toLatin1(); + m_cacheDirectory = parameters.value(QStringLiteral("googlemaps.cachefolder")).toString(); const int szCache = 100 * 1024 * 1024; #if QT_VERSION < QT_VERSION_CHECK(5,6,0)