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.
This commit is contained in:
Mark Liversedge
2011-05-22 11:56:33 +01:00
parent 4c6d926780
commit 4851dfcbd7

View File

@@ -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());
}
}