Changeset 4428 in josm


Ignore:
Timestamp:
2011-09-16T13:06:41+02:00 (13 years ago)
Author:
stoecker
Message:

fix #6481 - default layers vanishing after first start

File:
1 edited

Legend:

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

    r4240 r4428  
    3838
    3939    public void load() {
     40        boolean addedDefault = layers.size() != 0;
    4041        for(Collection<String> c : Main.pref.getArray("imagery.layers",
    4142                Collections.<Collection<String>>emptySet())) {
     
    5758        }
    5859        Collections.sort(layers);
     60        if(addedDefault)
     61            save();
    5962    }
    6063
     
    8184        }
    8285        while (defaultLayers.remove(null)) {}
    83        
     86
    8487        Collection<String> defaults = Main.pref.getCollection("imagery.layers.default");
    8588        ArrayList<String> defaultsSave = new ArrayList<String>();
     
    8790            if (def.isDefaultEntry()) {
    8891                defaultsSave.add(def.getUrl());
    89                
     92
    9093                boolean isKnownDefault = false;
    9194                for (String url : defaults) {
     
    114117                ? defaultsSave : defaults);
    115118    }
    116    
     119
    117120    // some additional checks to respect extended URLs in preferences (legacy workaround)
    118121    private boolean isSimilar(String a, String b) {
Note: See TracChangeset for help on using the changeset viewer.