Skip to content

Commit

Permalink
fix #6629: sort by favorite percent now respects attended/photo taken
Browse files Browse the repository at this point in the history
  • Loading branch information
Bananeweizen committed Jul 8, 2017
1 parent ae0d9ee commit b95b0a7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions main/src/cgeo/geocaching/models/Geocache.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -1964,11 +1965,16 @@ public int getFindsCount() {
if (getLogCounts().isEmpty()) {
setLogCounts(inDatabase() ? DataStore.loadLogCounts(getGeocode()) : Collections.<LogType, Integer>emptyMap());
}
final Integer logged = getLogCounts().get(LogType.FOUND_IT);
if (logged != null) {
return logged;
int sumFound = 0;
for (final Entry<LogType, Integer> logCount : getLogCounts().entrySet()) {
if (logCount.getKey().isFoundLog()) {
final Integer logged = logCount.getValue();
if (logged != null) {
sumFound += logged;
}
}
}
return 0;
return sumFound;
}

public boolean applyDistanceRule() {
Expand Down

0 comments on commit b95b0a7

Please sign in to comment.