- Timestamp:
- 2011-02-10T11:50:23+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java
r3855 r3883 12 12 import java.util.Collections; 13 13 import java.util.HashMap; 14 import java.util.Iterator; 15 import java.util.LinkedHashSet; 14 16 import java.util.List; 17 import java.util.Set; 15 18 16 19 import javax.swing.BorderFactory; … … 29 32 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.ValidationListener; 30 33 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry; 34 import org.openstreetmap.josm.gui.preferences.SourceEntry; 31 35 import org.openstreetmap.josm.gui.tagging.TaggingPreset; 32 36 import org.openstreetmap.josm.gui.tagging.TaggingPresetMenu; … … 300 304 301 305 @Override 306 public List<SourceEntry> get() { 307 List<SourceEntry> ls = new ArrayList<SourceEntry>(super.get()); 308 if (removeDeprecated(ls)) { 309 put(ls); 310 } 311 return ls; 312 } 313 314 /** 315 * The internal path of elemstyles.xml has changed, this 316 * can be removed when a few months have passed. 317 */ 318 private boolean removeDeprecated(List<SourceEntry> ls) { 319 boolean changed = false; 320 Iterator<SourceEntry> it = ls.iterator(); 321 while (it.hasNext()) { 322 SourceEntry se = it.next(); 323 if (se.url.equals("resource://data/elemstyles.xml")) { 324 it.remove(); 325 changed = true; 326 } 327 } 328 return changed; 329 } 330 331 @Override 302 332 public Collection<ExtendedSourceEntry> getDefault() { 303 333 ExtendedSourceEntry i = new ExtendedSourceEntry("defaultpresets.xml", "resource://data/defaultpresets.xml");
Note:
See TracChangeset
for help on using the changeset viewer.