Changeset 11400 in josm


Ignore:
Timestamp:
2016-12-15T00:55:15+01:00 (7 years ago)
Author:
Don-vip
Message:

drop old stuff

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

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

    r11374 r11400  
    15131513     */
    15141514    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
    15451516        removeUrlFromEntries(loadedVersion, 10063,
    15461517                "validator.org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.entries",
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java

    r11169 r11400  
    239239
    240240    private static void removeStaleFiles(String basePathPart, String suffix) {
    241         deleteCacheFiles(basePathPart); // TODO: this can be removed around 2016.09
    242         deleteCacheFiles(basePathPart + "_BLOCK"); // TODO: this can be removed around 2016.09
    243         deleteCacheFiles(basePathPart + "_INDEX"); // TODO: this can be removed around 2016.09
    244241        deleteCacheFiles(basePathPart + suffix);
    245242    }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r11137 r11400  
    66import java.io.File;
    77import java.io.IOException;
    8 import java.io.Reader;
    98import java.util.ArrayList;
    109import java.util.Arrays;
     
    1716
    1817import javax.swing.ImageIcon;
    19 import javax.swing.JOptionPane;
    2018import javax.swing.SwingUtilities;
    2119
     
    2523import org.openstreetmap.josm.data.osm.Node;
    2624import org.openstreetmap.josm.data.osm.Tag;
    27 import org.openstreetmap.josm.gui.HelpAwareOptionPane;
    2825import org.openstreetmap.josm.gui.PleaseWaitRunnable;
    29 import org.openstreetmap.josm.gui.help.HelpUtil;
    3026import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
    3127import org.openstreetmap.josm.gui.mappaint.styleelement.MapImage;
     
    3632import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    3733import org.openstreetmap.josm.io.CachedFile;
    38 import org.openstreetmap.josm.io.IllegalDataException;
    3934import org.openstreetmap.josm.tools.ImageProvider;
    4035import org.openstreetmap.josm.tools.Utils;
     
    4843 */
    4944public 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";
    5445
    5546    private static final Collection<String> DEPRECATED_IMAGE_NAMES = Arrays.asList(
     
    302293
    303294    private static StyleSource fromSourceEntry(SourceEntry entry) {
    304         // TODO: Method to clean up in November 2016: remove XML detection completely
    305295        Set<String> mimes = new HashSet<>(Arrays.asList(MapCSSStyleSource.MAPCSS_STYLE_MIME_TYPES.split(", ")));
    306         mimes.addAll(Arrays.asList(XML_STYLE_MIME_TYPES.split(", ")));
    307296        try (CachedFile cf = new CachedFile(entry.url).setHttpAccept(Utils.join(", ", mimes))) {
    308297            String zipEntryPath = cf.findZipEntryPath("mapcss", "style");
     
    310299                entry.isZip = true;
    311300                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            }
    338302            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        }
    351304    }
    352305
Note: See TracChangeset for help on using the changeset viewer.