Changeset 2889 in josm for trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
- Timestamp:
- 24.01.2010 14:20:12 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r2813 r2889 12 12 import java.awt.event.ActionEvent; 13 13 import java.io.BufferedReader; 14 import java.io.File; 14 15 import java.io.IOException; 16 import java.io.InputStream; 15 17 import java.io.InputStreamReader; 16 18 import java.io.Reader; … … 18 20 import java.util.Arrays; 19 21 import java.util.Collection; 22 import java.util.Collections; 20 23 import java.util.HashMap; 21 24 import java.util.LinkedHashMap; … … 72 75 public String locale_name; 73 76 public final static String OPTIONAL_TOOLTIP_TEXT = "Optional tooltip text"; 77 private static File zipIcons = null; 74 78 75 79 public static abstract class Item { … … 550 554 public void setIcon(String iconName) { 551 555 Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null); 552 ImageIcon icon = ImageProvider.getIfAvailable(s, "presets", null, iconName );556 ImageIcon icon = ImageProvider.getIfAvailable(s, "presets", null, iconName, zipIcons); 553 557 if (icon == null) 554 558 { … … 636 640 try { 637 641 MirroredInputStream s = new MirroredInputStream(source); 642 InputStream zip = s.getZipEntry("xml","preset"); 643 if(zip != null) 644 zipIcons = s.getFile(); 638 645 InputStreamReader r; 639 646 try 640 647 { 641 r = new InputStreamReader( s, "UTF-8");648 r = new InputStreamReader(zip == null ? s : zip, "UTF-8"); 642 649 } 643 650 catch (UnsupportedEncodingException e) 644 651 { 645 r = new InputStreamReader( s);652 r = new InputStreamReader(zip == null ? s: zip); 646 653 } 647 654 allPresets.addAll(TaggingPreset.readAll(new BufferedReader(r))); … … 663 670 ); 664 671 } 672 zipIcons = null; 665 673 } 666 674 return allPresets;
Note: See TracChangeset
for help on using the changeset viewer.
