Changeset 7831 in josm for trunk/src


Ignore:
Timestamp:
2014-12-19T13:30:53+01:00 (5 years ago)
Author:
Don-vip
Message:

see #10026 - use recommended preferences directory on OSX. Linux and Windows behaviour is unchanged.

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

Legend:

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

    r7829 r7831  
    550550            preferencesDirFile = new File(path).getAbsoluteFile();
    551551        } else {
    552             path = System.getenv("APPDATA");
    553             if (path != null) {
    554                 preferencesDirFile = new File(path, "JOSM");
    555             } else {
    556                 preferencesDirFile = new File(System.getProperty("user.home"), ".josm");
    557             }
     552            preferencesDirFile = Main.platform.getDefaultPrefDirectory();
    558553        }
    559554        return preferencesDirFile;
  • trunk/src/org/openstreetmap/josm/tools/PlatformHook.java

    r7829 r7831  
    127127     */
    128128    public File getDefaultCacheDirectory();
     129
     130    /**
     131     * Returns the platform-dependent default preferences directory.
     132     * @return the platform-dependent default preferences directory
     133     * @since 7831
     134     */
     135    public File getDefaultPrefDirectory();
    129136}
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java

    r7829 r7831  
    328328        return new File(System.getProperty("user.home")+"/Library/Caches", "JOSM");
    329329    }
     330
     331    @Override
     332    public File getDefaultPrefDirectory() {
     333        return new File(System.getProperty("user.home")+"/Library/Preferences", "JOSM");
     334    }
    330335}
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r7829 r7831  
    375375        return new File(Main.pref.getPreferencesDirFile(), "cache");
    376376    }
     377
     378    @Override
     379    public File getDefaultPrefDirectory() {
     380        return new File(System.getProperty("user.home"), ".josm");
     381    }
    377382}
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java

    r7829 r7831  
    288288        return new File(System.getenv("LOCALAPPDATA")+"/JOSM", "cache");
    289289    }
     290
     291    @Override
     292    public File getDefaultPrefDirectory() {
     293        return new File(System.getenv("APPDATA"), "JOSM");
     294    }
    290295}
Note: See TracChangeset for help on using the changeset viewer.