From 4851dfcbd78c2f2fc767e847e8f0bed7375d05d0 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Sun, 22 May 2011 11:56:33 +0100 Subject: [PATCH] Fix temp file permissions issue with Google Map The google map control creates a temporary file to load which is not unique for each logged in user. This causes permissions issues. The use of a temporary file has been removed by replacing the webView->load() call with a webView->setHtml() call. This allows us to pass the contents as a string rather than a URL. Fixes #331. --- src/GoogleMapControl.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/GoogleMapControl.cpp b/src/GoogleMapControl.cpp index 54a92e212..c5c0891c7 100644 --- a/src/GoogleMapControl.cpp +++ b/src/GoogleMapControl.cpp @@ -257,19 +257,7 @@ void GoogleMapControl::loadRide() createHtml(); newRideToLoad = false; loadingPage = true; - - QString htmlFile(QDir::tempPath()); - htmlFile.append("/maps.html"); - QFile file(htmlFile); - file.remove(); - file.open(QIODevice::ReadWrite); - file.write(currentPage.str().c_str(),currentPage.str().length()); - file.flush(); - file.close(); - QString filename("file:///"); - filename.append(htmlFile); - QUrl url(filename); - view->load(url); + view->setHtml(currentPage.str().c_str()); } }