Ignore:
Timestamp:
2016-03-12T00:10:24+01:00 (8 years ago)
Author:
Don-vip
Message:

fix #12282 - drop XML mappaint support - keep XML detection in order to warn users and let them upgrade to MapCSS, with link to documentation

File:
1 edited

Legend:

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

    r9911 r9965  
    14341434     */
    14351435    private void removeObsolete(int loadedVersion) {
    1436         // drop this block march 2016
    1437         // update old style JOSM server links to use zip now, see #10581, #12189
    1438         // actually also cache and mirror entries should be cleared
    1439         if (loadedVersion < 9216) {
    1440             for (String key: new String[]{"mappaint.style.entries", "taggingpreset.entries"}) {
    1441                 Collection<Map<String, String>> data = getListOfStructs(key, (Collection<Map<String, String>>) null);
    1442                 if (data != null) {
    1443                     List<Map<String, String>> newlist = new ArrayList<>();
    1444                     boolean modified = false;
    1445                     for (Map<String, String> map : data) {
    1446                          Map<String, String> newmap = new LinkedHashMap<>();
    1447                          for (Entry<String, String> entry : map.entrySet()) {
    1448                              String val = entry.getValue();
    1449                              String mkey = entry.getKey();
    1450                              if ("url".equals(mkey) && val.contains("josm.openstreetmap.de/josmfile") && !val.contains("zip=1")) {
    1451                                  val += "&zip=1";
    1452                                  modified = true;
    1453                              }
    1454                              if ("url".equals(mkey) && val.contains("http://josm.openstreetmap.de/josmfile")) {
    1455                                  val = val.replace("http://", "https://");
    1456                                  modified = true;
    1457                              }
    1458                              newmap.put(mkey, val);
    1459                          }
    1460                          newlist.add(newmap);
    1461                     }
    1462                     if (modified) {
    1463                         putListOfStructs(key, newlist);
    1464                     }
    1465                 }
    1466             }
    1467         }
    14681436        /* drop in October 2016 */
    14691437        if (loadedVersion < 9715) {
     
    14911459            }
    14921460        }
     1461        // drop in November 2016
     1462        if (loadedVersion < 9965) {
     1463            Setting<?> setting = settingsMap.get("mappaint.style.entries");
     1464            if (setting != null && setting instanceof MapListSetting) {
     1465                List<Map<String, String>> l = new LinkedList<>();
     1466                boolean modified = false;
     1467                for (Map<String, String> map: ((MapListSetting) setting).getValue()) {
     1468                    String url = map.get("url");
     1469                    if (url != null && url.contains("josm.openstreetmap.de/josmfile?page=Styles/LegacyStandard")) {
     1470                        modified = true;
     1471                    } else {
     1472                        l.add(map);
     1473                    }
     1474                }
     1475                if (modified) {
     1476                    putListOfStructs("mappaint.style.entries", l);
     1477                }
     1478            }
     1479        }
    14931480
    14941481        for (String key : OBSOLETE_PREF_KEYS) {
Note: See TracChangeset for help on using the changeset viewer.