Changeset 11424 in josm
- Timestamp:
- 2016-12-31T17:29:54+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r11400 r11424 68 68 import org.openstreetmap.josm.data.preferences.Setting; 69 69 import org.openstreetmap.josm.data.preferences.StringSetting; 70 import org.openstreetmap.josm.gui.preferences.validator.ValidatorTagCheckerRulesPreference; 71 import org.openstreetmap.josm.gui.preferences.validator.ValidatorTagCheckerRulesPreference.RulePrefHelper; 70 72 import org.openstreetmap.josm.io.OfflineAccessException; 71 73 import org.openstreetmap.josm.io.OnlineResource; … … 1521 1523 migrateOldColorKeys(); 1522 1524 } 1525 // drop in September 2017 1526 if (loadedVersion < 11424) { 1527 addNewerDefaultEntry( 1528 "validator.org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.entries", 1529 "resource://data/validator/territories.mapcss"); 1530 } 1523 1531 1524 1532 for (String key : OBSOLETE_PREF_KEYS) { … … 1570 1578 } 1571 1579 1580 private void addNewerDefaultEntry(String key, final String url) { 1581 Setting<?> setting = settingsMap.get(key); 1582 if (setting instanceof MapListSetting) { 1583 List<Map<String, String>> l = new ArrayList<>(((MapListSetting) setting).getValue()); 1584 if (l.stream().noneMatch(x -> x.values().contains(url))) { 1585 RulePrefHelper helper = ValidatorTagCheckerRulesPreference.RulePrefHelper.INSTANCE; 1586 l.add(helper.serialize(helper.getDefault().stream().filter(x -> url.equals(x.url)).findFirst().get())); 1587 putListOfStructs(key, l); 1588 } 1589 } 1590 } 1591 1572 1592 /** 1573 1593 * Enables or not the preferences file auto-save mechanism (save each time a setting is changed).
Note:
See TracChangeset
for help on using the changeset viewer.