Changeset 8100 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2015-02-22T23:58:28+01:00 (9 years ago)
Author:
stoecker
Message:

fix #10581 - rewrite old URL's to JOSM server

File:
1 edited

Legend:

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

    r8071 r8100  
    16751675     */
    16761676    public void removeObsolete() {
    1677         /* update the data with old consumer key*/
    1678         if(getInteger("josm.version", Version.getInstance().getVersion()) < 6076) {
    1679             if(!get("oauth.access-token.key").isEmpty() && get("oauth.settings.consumer-key").isEmpty()) {
    1680                 put("oauth.settings.consumer-key", "AdCRxTpvnbmfV8aPqrTLyA");
    1681                 put("oauth.settings.consumer-secret", "XmYOiGY9hApytcBC3xCec3e28QBqOWz5g6DSb5UpE");
     1677        // drop this block end of 2015
     1678        // update old style JOSM server links to use zip now, see #10581
     1679        // actually also cache and mirror entries should be cleared
     1680        if(getInteger("josm.version", Version.getInstance().getVersion()) < 8099) {
     1681            for(String key: new String[]{"mappaint.style.entries", "taggingpreset.entries"}) {
     1682                Collection<Map<String, String>> data = getListOfStructs(key, (Collection<Map<String, String>>) null);
     1683                if (data != null) {
     1684                    List<Map<String, String>> newlist = new ArrayList<Map<String, String>>();
     1685                    boolean modified = false;
     1686                    for(Map<String, String> map : data)
     1687                    {
     1688                         Map<String, String> newmap = new LinkedHashMap<String, String>();
     1689                         for (Entry<String, String> entry : map.entrySet()) {
     1690                             String val = entry.getValue();
     1691                             String mkey = entry.getKey();
     1692                             if ("url".equals(mkey) && val.contains("josm.openstreetmap.de/josmfile") && !val.contains("zip=1")) {
     1693                                 val += "&zip=1";
     1694                                 modified = true;
     1695                                 
     1696                             }
     1697                             newmap.put(mkey, val);
     1698                         }
     1699                         newlist.add(newmap);
     1700                    }
     1701                    if (modified) {
     1702                        putListOfStructs(key, newlist);
     1703                    }
     1704                }
    16821705            }
    16831706        }
Note: See TracChangeset for help on using the changeset viewer.