Changeset 14144 in josm
- Timestamp:
- 2018-08-12T14:45:46+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r14138 r14144 281 281 addPossibleResourceDir(locations, getSystemEnv("JOSM_RESOURCES")); 282 282 addPossibleResourceDir(locations, getSystemProperty("josm.resources")); 283 if (PlatformManager.isPlatformWindows()) { 284 String appdata = getSystemEnv("APPDATA"); 285 if (appdata != null && getSystemEnv("ALLUSERSPROFILE") != null 286 && appdata.lastIndexOf(File.separator) != -1) { 287 appdata = appdata.substring(appdata.lastIndexOf(File.separator)); 288 locations.add(new File(new File(getSystemEnv("ALLUSERSPROFILE"), 289 appdata), "JOSM").getPath()); 290 } 291 } else { 292 locations.add("/usr/local/share/josm/"); 293 locations.add("/usr/local/lib/josm/"); 294 locations.add("/usr/share/josm/"); 295 locations.add("/usr/lib/josm/"); 296 } 283 locations.addAll(PlatformManager.getPlatform().getPossiblePreferenceDirs()); 297 284 return locations; 298 285 } -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r14120 r14144 18 18 import java.util.stream.Collectors; 19 19 20 import org.openstreetmap.josm.Main;21 20 import org.openstreetmap.josm.command.AddCommand; 22 21 import org.openstreetmap.josm.command.ChangeCommand; … … 1046 1045 * 1047 1046 * @param nodes the list of nodes representing the polygon 1048 * @param projection the projection to use for the calculation, {@code null} defaults to {@link Main#getProjection()}1047 * @param projection the projection to use for the calculation, {@code null} defaults to {@link ProjectionRegistry#getProjection()} 1049 1048 * @return area and perimeter 1050 1049 * @since 13638 (signature) -
trunk/src/org/openstreetmap/josm/tools/PlatformHook.java
r13691 r14144 16 16 import java.security.cert.X509Certificate; 17 17 import java.text.DateFormat; 18 import java.util.Collection; 19 import java.util.Collections; 18 20 import java.util.Date; 19 21 import java.util.List; … … 369 371 return file; 370 372 } 373 374 /** 375 * Returns a set of possible platform specific directories where resources could be stored. 376 * @return A set of possible platform specific directories where resources could be stored. 377 * @since 14144 378 */ 379 default Collection<String> getPossiblePreferenceDirs() { 380 return Collections.emptyList(); 381 } 371 382 } -
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r13695 r14144 24 24 import java.security.cert.X509Certificate; 25 25 import java.util.Arrays; 26 import java.util.Collection; 27 import java.util.HashSet; 26 28 import java.util.Locale; 29 import java.util.Set; 27 30 import java.util.concurrent.ExecutionException; 28 31 … … 419 422 return null; 420 423 } 424 425 @Override 426 public Collection<String> getPossiblePreferenceDirs() { 427 Set<String> locations = new HashSet<>(); 428 locations.add("/usr/local/share/josm/"); 429 locations.add("/usr/local/lib/josm/"); 430 locations.add("/usr/share/josm/"); 431 locations.add("/usr/lib/josm/"); 432 return locations; 433 } 421 434 } -
trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
r13791 r14144 65 65 import java.util.Collection; 66 66 import java.util.Enumeration; 67 import java.util.HashSet; 67 68 import java.util.List; 68 69 import java.util.Locale; 69 70 import java.util.Properties; 71 import java.util.Set; 70 72 import java.util.concurrent.ExecutionException; 71 73 import java.util.concurrent.TimeUnit; … … 781 783 return file; 782 784 } 785 786 @Override 787 public Collection<String> getPossiblePreferenceDirs() { 788 Set<String> locations = new HashSet<>(); 789 String appdata = getSystemEnv("APPDATA"); 790 if (appdata != null && getSystemEnv("ALLUSERSPROFILE") != null 791 && appdata.lastIndexOf(File.separator) != -1) { 792 appdata = appdata.substring(appdata.lastIndexOf(File.separator)); 793 locations.add(new File(new File(getSystemEnv("ALLUSERSPROFILE"), appdata), "JOSM").getPath()); 794 } 795 return locations; 796 } 783 797 }
Note:
See TracChangeset
for help on using the changeset viewer.