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


Ignore:
Timestamp:
2015-05-02T23:33:56+02:00 (10 years ago)
Author:
stoecker
Message:

remove old migration code

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

Legend:

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

    r8299 r8315  
    17091709
    17101710        String[] obsolete = {
    1711                 "osm.notes.enableDownload" // was used prior to r8071 when notes was an hidden feature. To remove end of 2015
     1711                "osm.notes.enableDownload", // was used prior to r8071 when notes was an hidden feature. To remove end of 2015
     1712                "mappaint.style.migration.switchedToMapCSS", // was used prior to 8315 for MapCSS switch. To remove end of 2015
     1713                "mappaint.style.migration.changedXmlName" // was used prior to 8315 for MapCSS switch. To remove end of 2015
    17121714        };
    17131715        for (String key : obsolete) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java

    r7402 r8315  
    218218            boolean changed = false;
    219219
    220             boolean addedMapcssStyle = false; // Migration code can be removed ~ Nov. 2014
    221 
    222220            Collection<String> knownDefaults = new TreeSet<>(Main.pref.getCollection("mappaint.style.known-defaults"));
    223221
     
    237235                    insertionIdx++;
    238236                    changed = true;
    239                     /* Migration code can be removed ~ Nov. 2014 */
    240                     if ("resource://styles/standard/elemstyles.mapcss".equals(def.url)) {
    241                         addedMapcssStyle = true;
    242                     }
    243237                } else {
    244238                    if (i >= insertionIdx) {
     
    254248            knownDefaults.remove(OLD_ELEMSTYLES_XML);
    255249            Main.pref.putCollection("mappaint.style.known-defaults", knownDefaults);
    256 
    257             /* Migration code can be removed ~ Nov. 2014 */
    258             if (addedMapcssStyle) {
    259                 // change title of the XML entry
    260                 // only do this once. If the user changes it afterward, do not touch
    261                 if (!Main.pref.getBoolean("mappaint.style.migration.changedXmlName", false)) {
    262                     SourceEntry josmXml = Utils.find(list, new Predicate<SourceEntry>() {
    263                         @Override
    264                         public boolean evaluate(SourceEntry se) {
    265                             return OLD_ELEMSTYLES_XML.equals(se.url);
    266                         }
    267                     });
    268                     if (josmXml != null) {
    269                         josmXml.title = tr("JOSM default (XML; old version)");
    270                         changed = true;
    271                     }
    272                     Main.pref.put("mappaint.style.migration.changedXmlName", true);
    273                 }
    274             }
    275 
    276             /* Migration code can be removed ~ Nov. 2014 */
    277             if (!Main.pref.getBoolean("mappaint.style.migration.switchedToMapCSS", false)) {
    278                 SourceEntry josmXml = Utils.find(list, new Predicate<SourceEntry>() {
    279                     @Override
    280                     public boolean evaluate(SourceEntry se) {
    281                         return "resource://styles/standard/elemstyles.xml".equals(se.url);
    282                     }
    283                 });
    284                 SourceEntry josmMapCSS = Utils.find(list, new Predicate<SourceEntry>() {
    285                     @Override
    286                     public boolean evaluate(SourceEntry se) {
    287                         return "resource://styles/standard/elemstyles.mapcss".equals(se.url);
    288                     }
    289                 });
    290                 if (josmXml != null && josmMapCSS != null && josmXml.active) {
    291                     josmMapCSS.active = true;
    292                     josmXml.active = false;
    293                     Main.info("Switched mappaint style from XML format to MapCSS (one time migration).");
    294                     changed = true;
    295                 }
    296                 // in any case, do this check only once:
    297                 Main.pref.put("mappaint.style.migration.switchedToMapCSS", true);
    298             }
    299250
    300251            // XML style is not bundled anymore
Note: See TracChangeset for help on using the changeset viewer.