Changeset 1018 in josm
- Timestamp:
- 2008-10-05T12:50:00+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r938 r1018 32 32 */ 33 33 public class Preferences { 34 34 35 /** 36 * Internal storage for the preferenced directory. 37 * Do not access this variable directly! 38 * @see #getPreferencesDirFile() 39 */ 40 private File preferencesDirFile = null; 41 35 42 public static interface PreferenceChangedListener { 36 43 void preferenceChanged(String key, String newValue); … … 80 87 } 81 88 82 public File getPreferencesDirFile() { 83 if (System.getenv("APPDATA") != null) 84 return new File(System.getenv("APPDATA"), "JOSM"); 85 return new File(System.getProperty("user.home"), ".josm"); 86 } 87 89 public File getPreferencesDirFile() { 90 if (preferencesDirFile != null) 91 return preferencesDirFile; 92 String path; 93 path = System.getProperty("josm.home"); 94 if (path != null) { 95 preferencesDirFile = new File(path); 96 } else { 97 path = System.getenv("APPDATA"); 98 if (path != null) { 99 preferencesDirFile = new File(path, "JOSM"); 100 } else { 101 preferencesDirFile = new File(System.getProperty("user.home"), ".josm"); 102 } 103 } 104 return preferencesDirFile; 105 } 106 88 107 public File getPluginsDirFile() { 89 108 return new File(getPreferencesDirFile(), "plugins");
Note:
See TracChangeset
for help on using the changeset viewer.