- Timestamp:
- 2016-12-15T00:55:15+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r11374 r11400 1513 1513 */ 1514 1514 private void removeObsolete(int loadedVersion) { 1515 /* drop in October 2016 */ 1516 if (loadedVersion < 9715) { 1517 Setting<?> setting = settingsMap.get("imagery.entries"); 1518 if (setting instanceof MapListSetting) { 1519 List<Map<String, String>> l = new LinkedList<>(); 1520 boolean modified = false; 1521 for (Map<String, String> map: ((MapListSetting) setting).getValue()) { 1522 Map<String, String> newMap = new HashMap<>(); 1523 for (Entry<String, String> entry: map.entrySet()) { 1524 String value = entry.getValue(); 1525 if ("noTileHeaders".equals(entry.getKey())) { 1526 value = value.replaceFirst("\":(\".*\")\\}", "\":[$1]}"); 1527 if (!value.equals(entry.getValue())) { 1528 modified = true; 1529 } 1530 } 1531 newMap.put(entry.getKey(), value); 1532 } 1533 l.add(newMap); 1534 } 1535 if (modified) { 1536 putListOfStructs("imagery.entries", l); 1537 } 1538 } 1539 } 1540 // drop in November 2016 1541 removeUrlFromEntries(loadedVersion, 9965, 1542 "mappaint.style.entries", 1543 "josm.openstreetmap.de/josmfile?page=Styles/LegacyStandard"); 1544 // drop in December 2016 1515 // drop in March 2017 1545 1516 removeUrlFromEntries(loadedVersion, 10063, 1546 1517 "validator.org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.entries", -
trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
r11169 r11400 239 239 240 240 private static void removeStaleFiles(String basePathPart, String suffix) { 241 deleteCacheFiles(basePathPart); // TODO: this can be removed around 2016.09242 deleteCacheFiles(basePathPart + "_BLOCK"); // TODO: this can be removed around 2016.09243 deleteCacheFiles(basePathPart + "_INDEX"); // TODO: this can be removed around 2016.09244 241 deleteCacheFiles(basePathPart + suffix); 245 242 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r11137 r11400 6 6 import java.io.File; 7 7 import java.io.IOException; 8 import java.io.Reader;9 8 import java.util.ArrayList; 10 9 import java.util.Arrays; … … 17 16 18 17 import javax.swing.ImageIcon; 19 import javax.swing.JOptionPane;20 18 import javax.swing.SwingUtilities; 21 19 … … 25 23 import org.openstreetmap.josm.data.osm.Node; 26 24 import org.openstreetmap.josm.data.osm.Tag; 27 import org.openstreetmap.josm.gui.HelpAwareOptionPane;28 25 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 29 import org.openstreetmap.josm.gui.help.HelpUtil;30 26 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 31 27 import org.openstreetmap.josm.gui.mappaint.styleelement.MapImage; … … 36 32 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 37 33 import org.openstreetmap.josm.io.CachedFile; 38 import org.openstreetmap.josm.io.IllegalDataException;39 34 import org.openstreetmap.josm.tools.ImageProvider; 40 35 import org.openstreetmap.josm.tools.Utils; … … 48 43 */ 49 44 public final class MapPaintStyles { 50 51 /** To remove in November 2016 */52 private static final String XML_STYLE_MIME_TYPES =53 "application/xml, text/xml, text/plain; q=0.8, application/zip, application/octet-stream; q=0.5";54 45 55 46 private static final Collection<String> DEPRECATED_IMAGE_NAMES = Arrays.asList( … … 302 293 303 294 private static StyleSource fromSourceEntry(SourceEntry entry) { 304 // TODO: Method to clean up in November 2016: remove XML detection completely305 295 Set<String> mimes = new HashSet<>(Arrays.asList(MapCSSStyleSource.MAPCSS_STYLE_MIME_TYPES.split(", "))); 306 mimes.addAll(Arrays.asList(XML_STYLE_MIME_TYPES.split(", ")));307 296 try (CachedFile cf = new CachedFile(entry.url).setHttpAccept(Utils.join(", ", mimes))) { 308 297 String zipEntryPath = cf.findZipEntryPath("mapcss", "style"); … … 310 299 entry.isZip = true; 311 300 entry.zipEntryPath = zipEntryPath; 312 return new MapCSSStyleSource(entry); 313 } 314 zipEntryPath = cf.findZipEntryPath("xml", "style"); 315 if (zipEntryPath != null || Utils.hasExtension(entry.url, "xml")) 316 throw new IllegalDataException("XML style"); 317 if (Utils.hasExtension(entry.url, "mapcss")) 318 return new MapCSSStyleSource(entry); 319 try (Reader reader = cf.getContentReader()) { 320 WHILE: while (true) { 321 int c = reader.read(); 322 switch (c) { 323 case -1: 324 break WHILE; 325 case ' ': 326 case '\t': 327 case '\n': 328 case '\r': 329 continue; 330 case '<': 331 throw new IllegalDataException("XML style"); 332 default: 333 return new MapCSSStyleSource(entry); 334 } 335 } 336 } 337 Main.warn("Could not detect style type. Using default (mapcss)."); 301 } 338 302 return new MapCSSStyleSource(entry); 339 } catch (IOException e) { 340 Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", entry.url, e.toString())); 341 Main.error(e); 342 } catch (IllegalDataException e) { 343 String msg = tr("JOSM does no longer support mappaint styles written in the old XML format.\nPlease update ''{0}'' to MapCSS", 344 entry.url); 345 Main.error(msg); 346 Main.debug(e); 347 HelpAwareOptionPane.showOptionDialog(Main.parent, msg, tr("Warning"), JOptionPane.WARNING_MESSAGE, 348 HelpUtil.ht("/Styles/MapCSSImplementation")); 349 } 350 return null; 303 } 351 304 } 352 305
Note:
See TracChangeset
for help on using the changeset viewer.