forked from upstream-mirrors/OpenTracks
Cleanup: renaming Marker.category to typeLocalized.
This commit is contained in:
@@ -20,7 +20,7 @@ public class TrackFilenameGenerator {
|
||||
|
||||
public static final String UUID_KEY = "{uuid}";
|
||||
public static final String TRACKNAME_KEY = "{name}";
|
||||
public static final String ACTIVITY_TYPE_KEY = "{category}";
|
||||
public static final String ACTIVITY_TYPE_KEY = "{typeLocalized}";
|
||||
public static final String STARTTIME_TIME_KEY = "{time}";
|
||||
public static final String STARTTIME_DATE_KEY = "{date}";
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ public class GPXTrackExporter implements TrackExporter {
|
||||
printWriter.println("<time>" + StringUtils.formatDateTimeIso8601(marker.position().time(), zoneOffset) + "</time>");
|
||||
printWriter.println("<name>" + StringUtils.formatCData(marker.name()) + "</name>");
|
||||
printWriter.println("<desc>" + StringUtils.formatCData(marker.description()) + "</desc>");
|
||||
printWriter.println("<type>" + StringUtils.formatCData(marker.category()) + "</type>"); //TODO This is localized; may be better to export in English only. See #1608
|
||||
printWriter.println("<type>" + StringUtils.formatCData(marker.typeLocalized()) + "</type>"); //TODO This is localized; may be better to export in English only. See #1608
|
||||
printWriter.println("</wpt>");
|
||||
}
|
||||
|
||||
|
||||
@@ -266,10 +266,10 @@ public class KMLTrackExporter implements TrackExporter {
|
||||
|
||||
private void writeMarker(Marker marker, ZoneOffset zoneOffset) {
|
||||
boolean existsPhoto = MarkerUtils.buildInternalPhotoFile(context, marker.trackId(), marker.photoUrl()) != null;
|
||||
if (marker.photoUrl() != null && exportPhotos && existsPhoto) {
|
||||
if (exportPhotos && existsPhoto) {
|
||||
writePhotoOverlay(marker, zoneOffset);
|
||||
} else {
|
||||
writePlacemark(marker.name(), marker.category(), marker.description(), marker.position(), marker.position().time(), zoneOffset);
|
||||
writePlacemark(marker.name(), marker.typeLocalized(), marker.description(), marker.position(), marker.position().time(), zoneOffset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ public class KMLTrackExporter implements TrackExporter {
|
||||
printWriter.println("</Camera>");
|
||||
printWriter.println("<TimeStamp><when>" + getTime(zoneOffset, marker.position().time()) + "</when></TimeStamp>");
|
||||
printWriter.println("<styleUrl>#" + MARKER_STYLE + "</styleUrl>");
|
||||
writeTypeLocalized(marker.category());
|
||||
writeTypeLocalized(marker.typeLocalized());
|
||||
|
||||
if (exportPhotos) {
|
||||
printWriter.println("<Icon><href>" + KMZTrackExporter.buildKmzImageFilePath(marker) + "</href></Icon>");
|
||||
|
||||
@@ -142,7 +142,7 @@ public class KMLTrackImporter extends DefaultHandler implements XMLImporter.Trac
|
||||
public void startElement(String uri, String localName, String tag, Attributes attributes) throws SAXException {
|
||||
switch (tag) {
|
||||
case TAG_PLACEMARK, TAG_PHOTO_OVERLAY ->
|
||||
// Note that a track is contained in a Placemark, calling onMarkerStart will clear various track variables like name, category, and description.
|
||||
// Note that a track is contained in a Placemark, calling onMarkerStart will clear various track variables like name, typeLocalized, and description.
|
||||
onMarkerStart();
|
||||
case TAG_MULTI_TRACK, TAG_KML22_MULTI_TRACK -> trackImporter.newTrack();
|
||||
case TAG_TRACK, TAG_KML22_TRACK -> {
|
||||
|
||||
Reference in New Issue
Block a user