Changeset 13023 in josm for trunk/src


Ignore:
Timestamp:
2017-10-18T18:18:33+02:00 (7 years ago)
Author:
bastiK
Message:

see #15451 - fix initialization

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r12846 r13023  
    3737import org.openstreetmap.josm.data.osm.DataSet;
    3838import org.openstreetmap.josm.data.osm.OsmPrimitive;
     39import org.openstreetmap.josm.data.preferences.JosmBaseDirectories;
    3940import org.openstreetmap.josm.data.projection.Projection;
    4041import org.openstreetmap.josm.data.projection.ProjectionChangeListener;
     
    115116     * Global application preferences
    116117     */
    117     public static final Preferences pref = new Preferences();
     118    public static final Preferences pref = new Preferences(JosmBaseDirectories.getInstance());
    118119
    119120    /**
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r13021 r13023  
    4242import org.openstreetmap.josm.data.preferences.IntegerProperty;
    4343import org.openstreetmap.josm.data.preferences.ColorInfo;
    44 import org.openstreetmap.josm.data.preferences.JosmBaseDirectories;
    4544import org.openstreetmap.josm.data.preferences.LongProperty;
    4645import org.openstreetmap.josm.data.preferences.NamedColorProperty;
     
    464463     */
    465464    public File getPreferenceFile() {
    466         return new File(getPreferencesDirectory(false), "preferences.xml");
     465        return new File(dirs.getPreferencesDirectory(false), "preferences.xml");
    467466    }
    468467
     
    472471     */
    473472    public File getDefaultsCacheFile() {
    474         return new File(getCacheDirectory(true), "default_preferences.xml");
     473        return new File(dirs.getCacheDirectory(true), "default_preferences.xml");
    475474    }
    476475
     
    480479     */
    481480    public File getPluginsDirectory() {
    482         return new File(getUserDataDirectory(false), "plugins");
     481        return new File(dirs.getUserDataDirectory(false), "plugins");
    483482    }
    484483
     
    519518    public Collection<String> getAllPossiblePreferenceDirs() {
    520519        Set<String> locations = new HashSet<>();
    521         addPossibleResourceDir(locations, getPreferencesDirectory(false).getPath());
    522         addPossibleResourceDir(locations, getUserDataDirectory(false).getPath());
     520        addPossibleResourceDir(locations, dirs.getPreferencesDirectory(false).getPath());
     521        addPossibleResourceDir(locations, dirs.getUserDataDirectory(false).getPath());
    523522        addPossibleResourceDir(locations, System.getenv("JOSM_RESOURCES"));
    524523        addPossibleResourceDir(locations, System.getProperty("josm.resources"));
     
    818817        initSuccessful = false;
    819818        // get the preferences.
    820         File prefDir = getPreferencesDirectory(false);
     819        File prefDir = dirs.getPreferencesDirectory(false);
    821820        if (prefDir.exists()) {
    822821            if (!prefDir.isDirectory()) {
Note: See TracChangeset for help on using the changeset viewer.