aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/export/GpxExport.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2012-04-21 11:27:29 +0200
committerBananeweizen <bananeweizen@gmx.de>2012-04-21 11:27:29 +0200
commitfb453e599fed716636b6056739f17e318d55d25c (patch)
tree0b50af7331b93c5abca433a582f16521de7e0f6c /main/src/cgeo/geocaching/export/GpxExport.java
parent47ae07d7cec5d0a4e3a6b6f7bc79f03ef055716e (diff)
downloadcgeo-fb453e599fed716636b6056739f17e318d55d25c.zip
cgeo-fb453e599fed716636b6056739f17e318d55d25c.tar.gz
cgeo-fb453e599fed716636b6056739f17e318d55d25c.tar.bz2
refactorings
* always use CacheAttribute for attribute strings * avoid concatenation in append * use SparseArray instead of maps
Diffstat (limited to 'main/src/cgeo/geocaching/export/GpxExport.java')
-rw-r--r--main/src/cgeo/geocaching/export/GpxExport.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/export/GpxExport.java b/main/src/cgeo/geocaching/export/GpxExport.java
index 2c833a2..90ff7a0 100644
--- a/main/src/cgeo/geocaching/export/GpxExport.java
+++ b/main/src/cgeo/geocaching/export/GpxExport.java
@@ -1,8 +1,8 @@
package cgeo.geocaching.export;
+import cgeo.geocaching.LogEntry;
import cgeo.geocaching.R;
import cgeo.geocaching.cgCache;
-import cgeo.geocaching.LogEntry;
import cgeo.geocaching.cgeoapplication;
import cgeo.geocaching.activity.ActivityMixin;
import cgeo.geocaching.activity.Progress;
@@ -90,8 +90,8 @@ class GpxExport extends AbstractExport {
}
gpx.append("<wpt ");
- gpx.append("lat=\"" + cache.getCoords().getLatitude() + "\" ");
- gpx.append("lon=\"" + cache.getCoords().getLongitude() + "\">");
+ gpx.append("lat=\"").append(cache.getCoords().getLatitude()).append("\" ");
+ gpx.append("lon=\"").append(cache.getCoords().getLongitude()).append("\">");
gpx.append("<time>");
gpx.append(StringEscapeUtils.escapeXml(dateFormatZ.format(cache.getHiddenDate())));
@@ -114,8 +114,8 @@ class GpxExport extends AbstractExport {
gpx.append("</type>");
gpx.append("<groundspeak:cache ");
- gpx.append("available=\"" + (!cache.isDisabled() ? "True" : "False"));
- gpx.append("\" archived=\"" + (cache.isArchived() ? "True" : "False") + "\" ");
+ gpx.append("available=\"").append(!cache.isDisabled() ? "True" : "False");
+ gpx.append("\" archived=\"").append(cache.isArchived() ? "True" : "False").append("\" ");
gpx.append("xmlns:groundspeak=\"http://www.groundspeak.com/cache/1/0/1\">");
gpx.append("<groundspeak:name>");
@@ -144,7 +144,7 @@ class GpxExport extends AbstractExport {
for (String attribute : cache.getAttributes()) {
final CacheAttribute attr = CacheAttribute.getByGcRawName(CacheAttribute.trimAttributeName(attribute));
- final boolean enabled = attribute.endsWith(CacheAttribute.INTERNAL_YES);
+ final boolean enabled = CacheAttribute.isEnabled(attribute);
gpx.append("<groundspeak:attribute id=\"");
gpx.append(attr.id);