Changeset 7085 in josm
- Timestamp:
- 2014-05-09T06:41:29+02:00 (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/build.xml
r7079 r7085 267 267 <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/> 268 268 <replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/> 269 <!-- Works only on Windows, does nothing on Unix -->270 <attrib file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" readonly="true"/>271 <!-- Works only on Unix, does nothing on Windows -->272 <chmod file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" perm="ugo-w" verbose="true"/>273 269 </sequential> 274 270 </macrodef> -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r7083 r7085 86 86 */ 87 87 private File preferencesDirFile = null; 88 88 89 /** 89 90 * Internal storage for the cache directory. 90 91 */ 91 92 private File cacheDirFile = null; 93 94 /** 95 * Determines if preferences file is saved each time a property is changed. 96 */ 97 private boolean saveOnPut = true; 92 98 93 99 /** … … 1036 1042 settingsMap.put(key, settingCopy); 1037 1043 } 1038 try { 1039 save(); 1040 } catch (IOException e){ 1041 Main.warn(tr("Failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile())); 1044 if (saveOnPut) { 1045 try { 1046 save(); 1047 } catch (IOException e){ 1048 Main.warn(tr("Failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile())); 1049 } 1042 1050 } 1043 1051 } … … 1642 1650 return a.equals(b); 1643 1651 } 1652 1653 /** 1654 * Enables or not the preferences file auto-save mechanism (save each time a setting is changed). 1655 * This behaviour is enabled by default. 1656 * @param enable if {@code true}, makes JOSM save preferences file each time a setting is changed 1657 * @since 7085 1658 */ 1659 public final void enableSaveOnPut(boolean enable) { 1660 synchronized (this) { 1661 saveOnPut = enable; 1662 } 1663 } 1644 1664 } -
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r7081 r7085 47 47 System.setProperty("josm.home", josmHome); 48 48 Main.initApplicationPreferences(); 49 Main.pref.enableSaveOnPut(false); 49 50 I18n.init(); 50 51 // initialize the plaform hook, and
Note:
See TracChangeset
for help on using the changeset viewer.