diff options
author | blafoo <github@blafoo.de> | 2011-12-07 22:51:40 +0100 |
---|---|---|
committer | blafoo <github@blafoo.de> | 2011-12-10 22:43:11 +0100 |
commit | 53becbf2521e4157a1efb8ce6e7818c0591a5a83 (patch) | |
tree | 3d706968d757c1415e537e82141303804f93b228 /main/src/cgeo/geocaching/cgCache.java | |
parent | 63757148c69cdc6ab961fadbe4d3a25f1c69784d (diff) | |
download | cgeo-53becbf2521e4157a1efb8ce6e7818c0591a5a83.zip cgeo-53becbf2521e4157a1efb8ce6e7818c0591a5a83.tar.gz cgeo-53becbf2521e4157a1efb8ce6e7818c0591a5a83.tar.bz2 |
Friend logs
Diffstat (limited to 'main/src/cgeo/geocaching/cgCache.java')
-rw-r--r-- | main/src/cgeo/geocaching/cgCache.java | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java index ce96d58..5d2493c 100644 --- a/main/src/cgeo/geocaching/cgCache.java +++ b/main/src/cgeo/geocaching/cgCache.java @@ -779,9 +779,31 @@ public class cgCache implements ICache { } public List<cgLog> getLogs() { - return logs; + return getLogs(true); } + /** + * @param allLogs + * true for all logs, false for friend logs only + * @return the logs with all entries or just the entries of the friends + */ + public List<cgLog> getLogs(boolean allLogs) { + if (allLogs) { + return logs; + } + ArrayList<cgLog> friendLogs = new ArrayList<cgLog>(); + for (cgLog log : logs) { + if (log.friend) { + friendLogs.add(log); + } + } + return friendLogs; + } + + /** + * @param logs + * the log entries + */ public void setLogs(List<cgLog> logs) { this.logs = logs; } |