Changeset 14532 in josm


Ignore:
Timestamp:
2018-12-09T15:46:38+01:00 (5 months ago)
Author:
Don-vip
Message:

see #16073 - avoid spurious warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileSourceDisplaySettings.java

    r14120 r14532  
    3939
    4040    /**
    41      * A string returned by {@link DisplaySettingsChangeEvent#getChangedSetting()} if the sow errors property was changed.
     41     * A string returned by {@link DisplaySettingsChangeEvent#getChangedSetting()} if the show errors property was changed.
    4242     * @see TileSourceDisplaySettings#isShowErrors()
    4343     */
     
    9191
    9292    private TileSourceDisplaySettings(String... prefixes) {
    93         autoZoom = getProperty(prefixes, "default_autozoom");
    94         autoLoad = getProperty(prefixes, "default_autoload");
    95         showErrors = getProperty(prefixes, "default_showerrors");
    96     }
    97 
    98     private static boolean getProperty(String[] prefixes, String name) {
     93        autoZoom = getProperty(prefixes, "default_autozoom", PROP_AUTO_ZOOM.getDefaultValue());
     94        autoLoad = getProperty(prefixes, "default_autoload", PROP_AUTO_LOAD.getDefaultValue());
     95        showErrors = getProperty(prefixes, "default_showerrors", Boolean.TRUE);
     96    }
     97
     98    private static boolean getProperty(String[] prefixes, String name, Boolean def) {
    9999        // iterate through all values to force the preferences to receive the default value.
    100100        // we only support a default value of true.
     
    103103            String key = p + "." + name;
    104104            boolean currentValue = Config.getPref().getBoolean(key, true);
    105             if (!Config.getPref().get(key).isEmpty()) {
     105            if (!Config.getPref().get(key, def.toString()).isEmpty()) {
    106106                value = currentValue;
    107107            }
Note: See TracChangeset for help on using the changeset viewer.