Ignore:
Timestamp:
2017-09-13T23:24:50+02:00 (7 years ago)
Author:
bastiK
Message:

see #15229 - use Config.getPref() wherever possible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java

    r12674 r12846  
    1212import java.util.concurrent.CopyOnWriteArrayList;
    1313
    14 import org.openstreetmap.josm.Main;
    1514import org.openstreetmap.josm.data.preferences.StringProperty;
     15import org.openstreetmap.josm.spi.preferences.Config;
    1616
    1717/**
     
    230230    public String getDistText(final double dist, final NumberFormat format, final double threshold) {
    231231        double a = dist / aValue;
    232         if (a > bValue / aValue && !Main.pref.getBoolean("system_of_measurement.use_only_lower_unit", false))
     232        if (a > bValue / aValue && !Config.getPref().getBoolean("system_of_measurement.use_only_lower_unit", false))
    233233            return formatText(dist / bValue, bName, format);
    234234        else if (a < threshold)
     
    258258    public String getAreaText(final double area, final NumberFormat format, final double threshold) {
    259259        double a = area / (aValue*aValue);
    260         boolean lowerOnly = Main.pref.getBoolean("system_of_measurement.use_only_lower_unit", false);
    261         boolean customAreaOnly = Main.pref.getBoolean("system_of_measurement.use_only_custom_area_unit", false);
     260        boolean lowerOnly = Config.getPref().getBoolean("system_of_measurement.use_only_lower_unit", false);
     261        boolean customAreaOnly = Config.getPref().getBoolean("system_of_measurement.use_only_custom_area_unit", false);
    262262        if ((!lowerOnly && areaCustomValue > 0 && a > areaCustomValue / (aValue*aValue)
    263263                && a < (bValue*bValue) / (aValue*aValue)) || customAreaOnly)
Note: See TracChangeset for help on using the changeset viewer.