Changeset 12841 in josm for trunk/src/org/openstreetmap/josm/data/preferences
- Timestamp:
- 2017-09-13T16:30:27+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/preferences/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/preferences/sources/MapPaintPrefHelper.java
r12825 r12841 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.util.ArrayList; 6 7 import java.util.Arrays; 7 8 import java.util.Collection; … … 52 53 boolean changed = false; 53 54 54 Collection<String> knownDefaults = new TreeSet<>(Main.pref.get Collection("mappaint.style.known-defaults"));55 Collection<String> knownDefaults = new TreeSet<>(Main.pref.getList("mappaint.style.known-defaults")); 55 56 56 57 Collection<ExtendedSourceEntry> defaults = getDefault(); … … 70 71 knownDefaults.add(def.url); 71 72 } 72 Main.pref.put Collection("mappaint.style.known-defaults", knownDefaults);73 Main.pref.putList("mappaint.style.known-defaults", new ArrayList<>(knownDefaults)); 73 74 74 75 // XML style is not bundled anymore -
trunk/src/org/openstreetmap/josm/data/preferences/sources/SourcePrefHelper.java
r12825 r12841 58 58 public List<SourceEntry> get() { 59 59 60 Collection<Map<String, String>> src = Main.pref.getListOfStructs(pref, (Collection<Map<String, String>>)null);60 List<Map<String, String>> src = Main.pref.getListOfMaps(pref, null); 61 61 if (src == null) 62 62 return new ArrayList<>(getDefault()); … … 78 78 */ 79 79 public boolean put(Collection<? extends SourceEntry> entries) { 80 Collection<Map<String, String>> setting = serializeList(entries);81 boolean unset = Main.pref.getListOf Structs(pref, (Collection<Map<String, String>>)null) == null;80 List<Map<String, String>> setting = serializeList(entries); 81 boolean unset = Main.pref.getListOfMaps(pref, null) == null; 82 82 if (unset) { 83 83 Collection<Map<String, String>> def = serializeList(getDefault()); … … 85 85 return false; 86 86 } 87 return Main.pref.putListOf Structs(pref, setting);87 return Main.pref.putListOfMaps(pref, setting); 88 88 } 89 89 90 private Collection<Map<String, String>> serializeList(Collection<? extends SourceEntry> entries) {91 Collection<Map<String, String>> setting = new ArrayList<>(entries.size());90 private List<Map<String, String>> serializeList(Collection<? extends SourceEntry> entries) { 91 List<Map<String, String>> setting = new ArrayList<>(entries.size()); 92 92 for (SourceEntry e : entries) { 93 93 setting.add(serialize(e));
Note:
See TracChangeset
for help on using the changeset viewer.