Changeset 8710 in josm


Ignore:
Timestamp:
2015-09-01T20:34:28+02:00 (4 years ago)
Author:
simon04
Message:

see #11795 - taginfoextract: avoid "Could not get presets icon" by not loading icons

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/taginfoextract.groovy

    r8690 r8710  
    276276    void run_external_presets() {
    277277        init()
     278        TaggingPresetReader.setLoadIcons(false)
    278279        def sources = new TaggingPresetPreference.TaggingPresetSourceEditor().loadAndGetAvailableSources()
    279280        def tags = []
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r8510 r8710  
    153153    /**
    154154     * Called from the XML parser to set the icon.
    155      * This task is performed in the background in order to speedup startup.
     155     * The loading task is performed in the background in order to speedup startup.
    156156     */
    157157    public void setIcon(final String iconName) {
    158158        this.iconName = iconName;
     159        if (!TaggingPresetReader.isLoadIcons()) {
     160            return;
     161        }
    159162        File arch = TaggingPresetReader.getZipIcons();
    160163        final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java

    r8674 r8710  
    14651465
    14661466    public static Set<TaggingPresetType> getType(String types) throws SAXException {
     1467        if (types == null || types.isEmpty()) {
     1468            throw new SAXException(tr("Unknown type: {0}", types));
     1469        }
    14671470        if (TYPE_CACHE.containsKey(types))
    14681471            return TYPE_CACHE.get(types);
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java

    r8540 r8710  
    5151
    5252    private static volatile File zipIcons = null;
     53    private static volatile boolean loadIcons = true;
    5354
    5455    /**
     
    388389        return zipIcons;
    389390    }
     391
     392    /**
     393     * Returns true if icon images should be loaded.
     394     */
     395    public static boolean isLoadIcons() {
     396        return loadIcons;
     397    }
     398
     399    /**
     400     * Sets whether icon images should be loaded.
     401     */
     402    public static void setLoadIcons(boolean loadIcons) {
     403        TaggingPresetReader.loadIcons = loadIcons;
     404    }
    390405}
Note: See TracChangeset for help on using the changeset viewer.