- Timestamp:
- 2016-01-04T22:43:13+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r9296 r9311 151 151 152 152 /** 153 * Indicates whether {@link #init(boolean)} completed successfully. 154 * Used to decide whether to write backup preference file in {@link #save()} 155 */ 156 protected boolean initSuccessful = false; 157 158 /** 153 159 * Interface for a preference value. 154 160 * … … 862 868 863 869 // Backup old preferences if there are old preferences 864 if (prefFile.exists() ) {870 if (prefFile.exists() && prefFile.length() > 0 && initSuccessful) { 865 871 Utils.copyFile(prefFile, backupFile); 866 872 } … … 921 927 */ 922 928 public void init(boolean reset) { 929 initSuccessful = false; 923 930 // get the preferences. 924 931 File prefDir = getPreferencesDirectory(); … … 975 982 try { 976 983 load(); 984 initSuccessful = true; 977 985 } catch (Exception e) { 978 986 Main.error(e);
Note:
See TracChangeset
for help on using the changeset viewer.