Changeset 4920 in josm


Ignore:
Timestamp:
2012-02-12T14:00:28+01:00 (13 years ago)
Author:
stoecker
Message:

removed preferences not stored in file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r4900 r4920  
    266266    }
    267267
     268    /* remove end of 2012 */
    268269    public File getOldPreferenceFile() {
    269270        return new File(getPreferencesDirFile(), "preferences");
     
    907908    }
    908909
     910    /* remove this workaround end of 2012, replace by direct access to structure */
    909911    synchronized private List<String> getCollectionInternal(String key) {
    910912        List<String> prop = collectionProperties.get(key);
     
    949951                if (valueCopy.contains(null)) throw new RuntimeException("Error: Null as list element in preference setting (key '"+key+"')");
    950952                collectionProperties.put(key, Collections.unmodifiableList(valueCopy));
    951                 try {
    952                     save();
    953                 } catch(IOException e){
    954                     System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
    955                 }
     953            }
     954            try {
     955                save();
     956            } catch(IOException e){
     957                System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
    956958            }
    957959        }
     
    10271029    }
    10281030
     1031    /* remove this workaround end of 2012 and replace by direct array access */
    10291032    synchronized private List<List<String>> getArrayInternal(String key) {
    10301033        List<List<String>> prop = arrayProperties.get(key);
     
    10781081                }
    10791082                arrayProperties.put(key, Collections.unmodifiableList(valueCopy));
    1080                 try {
    1081                     save();
    1082                 } catch(IOException e){
    1083                     System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
    1084                 }
     1083            }
     1084            try {
     1085                save();
     1086            } catch(IOException e){
     1087                System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
    10851088            }
    10861089        }
     
    11231126    }
    11241127
     1128    /* remove this workaround end of 2012 and use direct access to proper variable */
    11251129    private synchronized List<Map<String, String>> getListOfStructsInternal(String key) {
    11261130        List<Map<String, String>> prop = listOfStructsProperties.get(key);
     
    11771181                }
    11781182                listOfStructsProperties.put(key, Collections.unmodifiableList(valueCopy));
    1179                 try {
    1180                     save();
    1181                 } catch(IOException e){
    1182                     System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
    1183                 }
     1183            }
     1184            try {
     1185                save();
     1186            } catch(IOException e){
     1187                System.out.println(tr("Warning: failed to persist preferences to ''{0}''", getPreferenceFile().getAbsoluteFile()));
    11841188            }
    11851189        }
     
    12201224    /**
    12211225     * Get a list of hashes which are represented by a struct-like class.
    1222      * It reads lines of the form
    1223      *  > key.0=prop:val \u001e prop:val \u001e ... \u001e prop:val
    1224      *  > ...
    1225      *  > key.N=prop:val \u001e prop:val \u001e ... \u001e prop:val
    12261226     * Possible properties are given by fields of the class klass that have
    12271227     * the @pref annotation.
     
    16421642            /* don't save default values */
    16431643            if(s == null || !s.equals(r)) {
     1644                /* TODO: remove old format exception end of 2012 */
    16441645                if(r.contains("\u001e"))
    16451646                {
Note: See TracChangeset for help on using the changeset viewer.