Changeset 34741 in osm


Ignore:
Timestamp:
2018-11-25T22:05:36+01:00 (6 years ago)
Author:
donvip
Message:

fix #17030 - remove indoorhelper validator file

Location:
applications/editors/josm/plugins/indoorhelper
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/indoorhelper/src/controller/IndoorHelperController.java

    r34734 r34741  
    3131import java.util.ArrayList;
    3232import java.util.Collection;
    33 import java.util.Collections;
    3433import java.util.HashMap;
    3534import java.util.List;
     
    4746import org.openstreetmap.josm.data.osm.OsmPrimitive;
    4847import org.openstreetmap.josm.data.osm.Tag;
    49 import org.openstreetmap.josm.data.validation.OsmValidator;
    50 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker;
    5148import org.openstreetmap.josm.gui.MainApplication;
    5249import org.openstreetmap.josm.gui.MapFrame;
     
    172169    * The listener which provides the handling of the applyButton.
    173170    * Gets the texts which were written by the user and writes them to the OSM-data.
    174     * After that it checks the tagged data  with the built-in validator file.
     171    * After that it checks the tagged data.
    175172    *
    176173    * @author egru
     
    622619
    623620    /**
    624      * Forces JOSM to load the validator and mappaint settings.
     621     * Forces JOSM to load the mappaint settings.
    625622     */
    626623    private void updateSettings() {
    627624        Preferences.main().init(false);
    628         MapCSSTagChecker tagChecker = OsmValidator.getTest(MapCSSTagChecker.class);
    629             if (tagChecker != null) {
    630                 OsmValidator.initializeTests(Collections.singleton(tagChecker));
    631             }
    632 
    633             MapPaintStyles.readFromPreferences();
     625        MapPaintStyles.readFromPreferences();
    634626    }
    635627
    636628    /**
    637      * Enables or disables the preferences for the mapcss-style and the validator.
     629     * Enables or disables the preferences for the mapcss-style.
    638630     *
    639631     * @param enabled Activates or disables the settings.
     
    642634       Map<String, Setting<?>> settings = Preferences.main().getAllSettings();
    643635
    644        MapListSetting validatorMapListSetting = (MapListSetting) settings.
    645                get("validator.org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.entries");
    646        List<Map<String, String>> validatorMaps = new ArrayList<>();
    647        if (validatorMapListSetting != null) {
    648            validatorMaps = validatorMapListSetting.getValue();
    649        }
    650 
    651636       MapListSetting styleMapListSetting = (MapListSetting) settings.
    652637               get("mappaint.style.entries");
     
    657642
    658643       if (enabled) {
    659            //set the validator active
    660 
    661            List<Map<String, String>> validatorMapsNew = new ArrayList<>();
    662            if (!validatorMaps.isEmpty()) {
    663                validatorMapsNew.addAll(validatorMaps);
    664            }
    665 
    666            for (Map<String, String> map : validatorMapsNew) {
    667                if (map.containsValue(tr("Indoor"))) {
    668                    validatorMapsNew.remove(map);
    669                    break;
    670                }
    671            }
    672 
    673            Map<String, String> indoorValidator = new HashMap<>();
    674            indoorValidator.put("title", "Indoor");
    675            indoorValidator.put("active", "true");
    676            indoorValidator.put("url", Config.getDirs().getUserDataDirectory(true)+ sep +"validator" +
    677                    sep + "indoorhelper.validator.mapcss");
    678 
    679            validatorMapsNew.add(indoorValidator);
    680            Config.getPref().putListOfMaps("validator.org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.entries",
    681                    validatorMapsNew);
    682 
    683644           //set mappaint active
    684645
     
    704665           updateSettings();
    705666       } else {
    706            //set the validator inactive
    707 
    708 
    709            List<Map<String, String>> validatorMapsNew = new ArrayList<>();
    710            if (!validatorMaps.isEmpty()) {
    711                validatorMapsNew.addAll(validatorMaps);
    712            }
    713 
    714            for (Map<String, String> map : validatorMapsNew) {
    715                if (map.containsValue(tr("Indoor"))) {
    716                    validatorMapsNew.remove(map);
    717                    break;
    718                }
    719            }
    720            Map<String, String> indoorValidator = new HashMap<>();
    721            indoorValidator.put("title", tr("Indoor"));
    722            indoorValidator.put("active", "false");
    723            indoorValidator.put("url", Config.getDirs().getUserDataDirectory(true)+ sep +"validator" +
    724                    sep + "indoorhelper.validator.mapcss");
    725 
    726            validatorMapsNew.add(indoorValidator);
    727            Config.getPref().putListOfMaps("validator.org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.entries",
    728                    validatorMapsNew);
    729 
    730 
    731667           //set mappaint inactive
    732 
    733668
    734669           List<Map<String, String>> styleMapsNew = new ArrayList<>();
Note: See TracChangeset for help on using the changeset viewer.