Skip to content

Commit

Permalink
fix parsing of geo: urls from Calendar application
Browse files Browse the repository at this point in the history
  • Loading branch information
Karry committed May 20, 2024
1 parent 3f1715e commit 11b1853
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
21 changes: 12 additions & 9 deletions qml/pages/MapPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,19 @@ Page {
}
}
}

var coords = arr[0].split(';')[0].split(',');
if (coords.length < 2) {
console.log("cannot parse url: " + url);
networkErrorNotification.previewBody = qsTr("Cannot parse url %1").arg(url);
networkErrorNotification.publish();
return;
var lat = 0;
var lon = 0;
if (arr[0] != "") {
var coords = arr[0].split(';')[0].split(',');
if (coords.length < 2) {
console.log("cannot parse url: " + url);
networkErrorNotification.previewBody = qsTr("Cannot parse url %1").arg(url);
networkErrorNotification.publish();
return;
}
lat = Number(coords[0]);
lon = Number(coords[1]);
}
var lat = Number(coords[0]);
var lon = Number(coords[1]);
if (isNaN(lat) || isNaN(lon) || lat < -90 || lat > 90 || lon < -180 || lon > 180){
console.log("cannot parse url: " + url);
networkErrorNotification.previewBody = qsTr("Cannot parse url %1").arg(url);
Expand Down
3 changes: 2 additions & 1 deletion rpm/harbour-osmscout.changes.in
Original file line number Diff line number Diff line change
Expand Up @@ -625,4 +625,5 @@

* 2024-xx-xx Lukáš Karas <lukas.karas@centrum.cz> 2.35
- take initial vehicle bearing into account during (re)routing
- fix (workaround) crash when some page is shown during navigation (itinerary is for example)
- fix (workaround) crash when some page is shown during navigation (itinerary is for example)
- fix parsing of geo: urls from Calendar application

0 comments on commit 11b1853

Please sign in to comment.