aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorBananeweizen <Bananeweizen@gmx.de>2012-04-10 08:08:18 +0200
committerBananeweizen <Bananeweizen@gmx.de>2012-04-10 08:08:18 +0200
commit6f0722b7e104ad0370b939a2983bd596fac6c5d2 (patch)
tree8d652a556efaedf522bfe2851a057c3ee78f044e /main/src
parent882dc52efc9695ceac3c90ebb4dc2dd93056b3ad (diff)
downloadcgeo-6f0722b7e104ad0370b939a2983bd596fac6c5d2.zip
cgeo-6f0722b7e104ad0370b939a2983bd596fac6c5d2.tar.gz
cgeo-6f0722b7e104ad0370b939a2983bd596fac6c5d2.tar.bz2
fix cache attribute from 08d132878d4e8818c8090169e6f0ece257ac4732
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/CacheDetailActivity.java4
-rw-r--r--main/src/cgeo/geocaching/enumerations/CacheAttribute.java2
-rw-r--r--main/src/cgeo/geocaching/export/GpxExport.java16
3 files changed, 14 insertions, 8 deletions
diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java
index de754b9..dfd8dde 100644
--- a/main/src/cgeo/geocaching/CacheDetailActivity.java
+++ b/main/src/cgeo/geocaching/CacheDetailActivity.java
@@ -1157,7 +1157,7 @@ public class CacheDetailActivity extends AbstractActivity {
}
/**
- * lazy-creates the layout holding the icons of the chaches attributes
+ * lazy-creates the layout holding the icons of the caches attributes
* and makes it visible
*/
private void showAttributeIcons(LinearLayout attribBox, int parentWidth) {
@@ -1175,7 +1175,7 @@ public class CacheDetailActivity extends AbstractActivity {
}
/**
- * lazy-creates the layout holding the discriptions of the chaches attributes
+ * lazy-creates the layout holding the descriptions of the caches attributes
* and makes it visible
*/
private void showAttributeDescriptions(LinearLayout attribBox) {
diff --git a/main/src/cgeo/geocaching/enumerations/CacheAttribute.java b/main/src/cgeo/geocaching/enumerations/CacheAttribute.java
index d3c0aa7..3dbfce5 100644
--- a/main/src/cgeo/geocaching/enumerations/CacheAttribute.java
+++ b/main/src/cgeo/geocaching/enumerations/CacheAttribute.java
@@ -75,7 +75,7 @@ public enum CacheAttribute {
TOURIST_OK(63, "touristok"),
TREECLIMBING(64, "treeclimbing"),
FRONTYARD(65, "frontyard"),
- TEAMWORK(66, "teamwork_yes");
+ TEAMWORK(66, "teamwork");
public static final String INTERNAL_PRE = "attribute_";
public static final String INTERNAL_YES = "_yes";
diff --git a/main/src/cgeo/geocaching/export/GpxExport.java b/main/src/cgeo/geocaching/export/GpxExport.java
index 44a4f8d..ac4c336 100644
--- a/main/src/cgeo/geocaching/export/GpxExport.java
+++ b/main/src/cgeo/geocaching/export/GpxExport.java
@@ -49,7 +49,7 @@ public class GpxExport extends AbstractExport {
private File exportFile;
/**
- * Instantiates and configurates the task for exporting field notes.
+ * Instantiates and configures the task for exporting field notes.
*
* @param caches
* The {@link List} of {@link cgCache} to be exported
@@ -71,6 +71,12 @@ public class GpxExport extends AbstractExport {
@Override
protected Boolean doInBackground(Void... params) {
+ // quick check for being able to write the GPX file
+ if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+ return false;
+ }
+
+ // FIXME: complete export is created in memory. That should be some file stream instead.
final StringBuilder gpx = new StringBuilder();
gpx.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
@@ -145,9 +151,9 @@ public class GpxExport extends AbstractExport {
gpx.append(attr.id);
gpx.append("\" inc=\"");
if (enabled) {
- gpx.append("1");
+ gpx.append('1');
} else {
- gpx.append("0");
+ gpx.append('0');
}
gpx.append("\">");
gpx.append(StringEscapeUtils.escapeXml(attr.getL10n(enabled)));
@@ -246,7 +252,7 @@ public class GpxExport extends AbstractExport {
exportLocation.mkdirs();
SimpleDateFormat fileNameDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
- exportFile = new File(exportLocation + "/" + fileNameDateFormat.format(new Date()) + ".gpx");
+ exportFile = new File(exportLocation.toString() + '/' + fileNameDateFormat.format(new Date()) + ".gpx");
OutputStream os = null;
Writer fw = null;
@@ -279,7 +285,7 @@ public class GpxExport extends AbstractExport {
if (null != activity) {
progress.dismiss();
if (result) {
- ActivityMixin.showToast(activity, getName() + " " + getString(R.string.export_exportedto) + ": " + exportFile.toString());
+ ActivityMixin.showToast(activity, getName() + ' ' + getString(R.string.export_exportedto) + ": " + exportFile.toString());
} else {
ActivityMixin.showToast(activity, getString(R.string.export_failed));
}