mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
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:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user