Changeset 13815 in josm


Ignore:
Timestamp:
2018-05-22T00:45:56+02:00 (4 weeks ago)
Author:
Don-vip
Message:

fix #10047 - Initialize only active mappaint styles

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r13493 r13815  
    313313        }
    314314        for (StyleSource source : styles.getStyleSources()) {
    315             loadStyleForFirstTime(source);
     315            if (source.active) {
     316                loadStyleForFirstTime(source);
     317            }
    316318        }
    317319        fireMapPaintSylesUpdated();
     
    406408            StyleSource s = data.get(p);
    407409            s.active = !s.active;
     410            if (s.active && !s.isLoaded()) {
     411                loadStyleForFirstTime(s);
     412            }
    408413        }
    409414        MapPaintPrefHelper.INSTANCE.put(data);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java

    r13810 r13815  
    3939    private final List<Throwable> errors = new CopyOnWriteArrayList<>();
    4040    private final Set<String> warnings = new CopyOnWriteArraySet<>();
     41    protected boolean loaded;
     42
    4143    /**
    4244     * The zip file containing the icons for this style
     
    257259        return null;
    258260    }
     261
     262    /**
     263     * Determines if the style has been loaded (initialized).
     264     * @return {@code true} if the style has been loaded
     265     * @since 13815
     266     */
     267    public final boolean isLoaded() {
     268        return loaded;
     269    }
    259270}
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java

    r13811 r13815  
    507507            multipolygonRules.initIndex();
    508508            canvasRules.initIndex();
     509            loaded = true;
    509510        } finally {
    510511            STYLE_SOURCE_LOCK.writeLock().unlock();
Note: See TracChangeset for help on using the changeset viewer.