private SortType getEffectiveTypeFor(final SortType type) {
        switch (type) {
            case AUTO:
                return getAutoType();
            case TARGET_DISTANCE:
                return this.targetCoords != null ? SortType.TARGET_DISTANCE : SortType.DISTANCE;
            default:
                return type;
        }
    }
Sets sort context depending on a list context.
main/src/main/java/cgeo/geocaching/sorting/GeocacheSort.java