Ignore:
Timestamp:
2017-09-13T16:30:27+02:00 (7 years ago)
Author:
bastiK
Message:

see #15229 - fix deprecations caused by [12840]

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  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.util.ArrayList;
    67import java.util.Arrays;
    78import java.util.Collection;
     
    5253        boolean changed = false;
    5354
    54         Collection<String> knownDefaults = new TreeSet<>(Main.pref.getCollection("mappaint.style.known-defaults"));
     55        Collection<String> knownDefaults = new TreeSet<>(Main.pref.getList("mappaint.style.known-defaults"));
    5556
    5657        Collection<ExtendedSourceEntry> defaults = getDefault();
     
    7071            knownDefaults.add(def.url);
    7172        }
    72         Main.pref.putCollection("mappaint.style.known-defaults", knownDefaults);
     73        Main.pref.putList("mappaint.style.known-defaults", new ArrayList<>(knownDefaults));
    7374
    7475        // XML style is not bundled anymore
  • trunk/src/org/openstreetmap/josm/data/preferences/sources/SourcePrefHelper.java

    r12825 r12841  
    5858    public List<SourceEntry> get() {
    5959
    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);
    6161        if (src == null)
    6262            return new ArrayList<>(getDefault());
     
    7878     */
    7979    public boolean put(Collection<? extends SourceEntry> entries) {
    80         Collection<Map<String, String>> setting = serializeList(entries);
    81         boolean unset = Main.pref.getListOfStructs(pref, (Collection<Map<String, String>>) null) == null;
     80        List<Map<String, String>> setting = serializeList(entries);
     81        boolean unset = Main.pref.getListOfMaps(pref, null) == null;
    8282        if (unset) {
    8383            Collection<Map<String, String>> def = serializeList(getDefault());
     
    8585                return false;
    8686        }
    87         return Main.pref.putListOfStructs(pref, setting);
     87        return Main.pref.putListOfMaps(pref, setting);
    8888    }
    8989
    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());
    9292        for (SourceEntry e : entries) {
    9393            setting.add(serialize(e));
Note: See TracChangeset for help on using the changeset viewer.