diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2011-10-03 21:43:04 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2011-10-03 21:43:04 +0200 |
| commit | e00bdc178bcced04530e976791d1b29e247cdac0 (patch) | |
| tree | 48ef1908e5ad95d6ddd548389e7d3c988276227b /main/src/cgeo/geocaching/cgCache.java | |
| parent | a5fee4e58ff9d870adf00ab6a92ef2caee977531 (diff) | |
| download | cgeo-e00bdc178bcced04530e976791d1b29e247cdac0.zip cgeo-e00bdc178bcced04530e976791d1b29e247cdac0.tar.gz cgeo-e00bdc178bcced04530e976791d1b29e247cdac0.tar.bz2 | |
fix #360: don't load cache description, except when needed in details
view
This saves 1.6 MB RAM for 500 caches on my device.
Diffstat (limited to 'main/src/cgeo/geocaching/cgCache.java')
| -rw-r--r-- | main/src/cgeo/geocaching/cgCache.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java index 1ff1f96..3515286 100644 --- a/main/src/cgeo/geocaching/cgCache.java +++ b/main/src/cgeo/geocaching/cgCache.java @@ -59,7 +59,7 @@ public class cgCache implements ICache { public Double elevation = null; public String personalNote = null; public String shortdesc = ""; - public String description = ""; + private String description = null; public boolean disabled = false; public boolean archived = false; public boolean members = false; @@ -439,6 +439,9 @@ public class cgCache implements ICache { @Override public String getDescription() { + if (description == null) { + description = StringUtils.defaultString(cgeoapplication.getInstance().getCacheDescription(geocode)); + } return description; } @@ -507,4 +510,8 @@ public class cgCache implements ICache { return StringUtils.startsWithIgnoreCase(geocode, "GC"); } + public void setDescription(final String description) { + this.description = description; + } + } |
