Set the name to "Unnamed" (or translation) as fallback. The locale files
have to be updated therefore.
Before this change, these waypoints have been ignored when reading GPX files.
But according to the GPX schema version 1.1 the "name" element does not have to
exist.
Garmin Dakota 20 can create waypoints with an empty "name" element.
Also the OpenStreetMap Notes API currently creates waypoints without
"name" element.
---
src/CWptDB.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/CWptDB.cpp b/src/CWptDB.cpp
index 6b2062d..31bc8b2 100644
--- a/src/CWptDB.cpp
+++ b/src/CWptDB.cpp
@@ -466,6 +466,10 @@ void CWptDB::loadGPX(CGpx& gpx)
{
wpt->name = waypoint.namedItem("name").toElement().text();
}
+ if(wpt->name.isEmpty())
+ {
+ wpt->name = tr("Unnamed");
+ }
if(waypoint.namedItem("cmt").isElement())
{
wpt->comment = waypoint.namedItem("cmt").toElement().text();
@@ -567,7 +571,7 @@ void CWptDB::loadGPX(CGpx& gpx)
}
}
- if(wpt->lat == 1000 || wpt->lon == 1000 || (wpt->name.isEmpty() &&
wpt->comment.isEmpty()))
+ if(wpt->lat == 1000 || wpt->lon == 1000)
{
delete wpt;
continue;
--
2.4.5
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Qlandkartegt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users