Changeset 5763 in josm for trunk/src/org
- Timestamp:
- 2013-03-08T19:16:00+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java
r5170 r5763 101 101 cPath = Main.pref.getCacheDirectory() + File.separator + cPath; 102 102 } 103 // Migrate to new cache directory. Remove 2012-06104 {105 File oldPath = new File(Main.pref.getPreferencesDirFile(), "wms-cache");106 File newPath = new File(cPath);107 if (oldPath.exists() && !newPath.exists()) {108 oldPath.renameTo(newPath);109 }110 }111 103 return cPath; 112 104 } -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r5586 r5763 1503 1503 abstract public SourceEntry deserialize(Map<String, String> entryStr); 1504 1504 1505 // migration can be removed end 20121506 abstract public Map<String, String> migrate(Collection<String> old);1507 1508 1505 public List<SourceEntry> get() { 1509 1506 1510 boolean migration = false;1511 1507 Collection<Map<String, String>> src = Main.pref.getListOfStructs(pref, (Collection<Map<String, String>>) null); 1512 if (src == null) {1513 Collection<Collection<String>> srcOldPrefFormat = Main.pref.getArray(prefOld, null);1514 if (srcOldPrefFormat != null) {1515 migration = true;1516 src = new ArrayList<Map<String, String>>();1517 for (Collection<String> p : srcOldPrefFormat) {1518 src.add(migrate(p));1519 }1520 }1521 }1522 1508 if (src == null) 1523 1509 return new ArrayList<SourceEntry>(getDefault()); … … 1530 1516 } 1531 1517 } 1532 if (migration) {1533 put(entries);1534 }1535 1518 return entries; 1536 1519 } -
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
r5631 r5763 268 268 return new SourceEntry(s.get("url"), s.get("ptoken"), s.get("title"), Boolean.parseBoolean(s.get("active"))); 269 269 } 270 271 @Override272 public Map<String, String> migrate(Collection<String> old) {273 List<String> entryStr = new ArrayList<String>(old);274 if (entryStr.size() < 4)275 return null;276 Map<String, String> res = new HashMap<String, String>();277 res.put("url", entryStr.get(0));278 res.put("ptoken", entryStr.get(1));279 res.put("title", entryStr.get(2));280 res.put("active", entryStr.get(3));281 return res;282 }283 270 } 284 271 -
trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
r5631 r5763 336 336 return new SourceEntry(s.get("url"), null, s.get("title"), true); 337 337 } 338 339 @Override340 public Map<String, String> migrate(Collection<String> old) {341 List<String> entryStr = new ArrayList<String>(old);342 if (entryStr.size() < 2)343 return null;344 Map<String, String> res = new HashMap<String, String>();345 res.put("url", entryStr.get(0));346 res.put("title", entryStr.get(1));347 return res;348 }349 350 338 } 351 339
Note:
See TracChangeset
for help on using the changeset viewer.