summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Rauter <matthias.rauter@qt.io>2024-01-31 13:30:59 +0100
committerMatthias Rauter <matthias.rauter@qt.io>2024-02-06 11:50:06 +0100
commit106fc77a50c0bf6048bd9a0507e65d87479c5d3e (patch)
tree43844601bbc13e8a645c5be6aa969827403b8ef3
parent09cebafa5f77236b1c880be458a93ee713e02940 (diff)
Use QUrl::toLocalFile() in GeoJsonData
Using QUrl::path() stoped working with local files because a leading "/" was remaining in the path. Using QUrl::toLocalFile() works. Fixes: QTBUG-121766 Pick-to: 6.7 Change-Id: I3711d3aa030d54981f9089c3c0a3d4e46279a1ef Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/location/declarativemaps/qdeclarativegeojsondata.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeojsondata.cpp b/src/location/declarativemaps/qdeclarativegeojsondata.cpp
index ce3dc1c6..2066c9a9 100644
--- a/src/location/declarativemaps/qdeclarativegeojsondata.cpp
+++ b/src/location/declarativemaps/qdeclarativegeojsondata.cpp
@@ -220,7 +220,7 @@ bool QDeclarativeGeoJsonData::open()
bool QDeclarativeGeoJsonData::openUrl(const QUrl &url)
{
// Reading GeoJSON file
- QFile loadFile(url.path());
+ QFile loadFile(url.toLocalFile());
if (!loadFile.open(QIODevice::ReadOnly)) {
qWarning() << "Error while opening the file: " << url;
qWarning() << loadFile.errorString();