Changeset 9454 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2016-01-15T00:26:24+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r9284 r9454 63 63 import org.openstreetmap.josm.gui.mappaint.StyleElementList; 64 64 import org.openstreetmap.josm.gui.mappaint.styleelement.MapImage; 65 import org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement; 65 66 import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement; 66 67 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; … … 81 82 import com.kitfox.svg.SVGDiagram; 82 83 import com.kitfox.svg.SVGUniverse; 83 import org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement;84 84 85 85 /** … … 1057 1057 } 1058 1058 // Try user-data directory 1059 String dir = new File(Main.pref.getUserDataDirectory(), "images").getAbsolutePath(); 1060 try { 1061 u = getImageUrl(dir, imageName, additionalClassLoaders); 1062 if (u != null) 1063 return u; 1064 } catch (SecurityException e) { 1065 Main.warn(tr( 1066 "Failed to access directory ''{0}'' for security reasons. Exception was: {1}", dir, e 1067 .toString())); 1059 if (Main.pref != null) { 1060 String dir = new File(Main.pref.getUserDataDirectory(), "images").getAbsolutePath(); 1061 try { 1062 u = getImageUrl(dir, imageName, additionalClassLoaders); 1063 if (u != null) 1064 return u; 1065 } catch (SecurityException e) { 1066 Main.warn(tr( 1067 "Failed to access directory ''{0}'' for security reasons. Exception was: {1}", dir, e 1068 .toString())); 1069 } 1068 1070 } 1069 1071 … … 1079 1081 1080 1082 // Try all other resource directories 1081 for (String location : Main.pref.getAllPossiblePreferenceDirs()) { 1082 u = getImageUrl(location + "images", imageName, additionalClassLoaders); 1083 if (u != null) 1084 return u; 1085 u = getImageUrl(location, imageName, additionalClassLoaders); 1086 if (u != null) 1087 return u; 1083 if (Main.pref != null) { 1084 for (String location : Main.pref.getAllPossiblePreferenceDirs()) { 1085 u = getImageUrl(location + "images", imageName, additionalClassLoaders); 1086 if (u != null) 1087 return u; 1088 u = getImageUrl(location, imageName, additionalClassLoaders); 1089 if (u != null) 1090 return u; 1091 } 1088 1092 } 1089 1093
Note:
See TracChangeset
for help on using the changeset viewer.