Ignore:
Timestamp:
2014-12-19T15:05:33+01:00 (9 years ago)
Author:
Don-vip
Message:

see #10026 - use recommended user data directory on OSX (distinct from preferences directory). Linux and Windows behaviour is unchanged.

Location:
trunk/src/org/openstreetmap/josm/io
Files:
3 edited

Legend:

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

    r7434 r7834  
    7979     *  <li>{@code http://...} a URL. It will be cached on disk.</li></ul>
    8080     *  <li>{@code resource://SOME/FILE} file from the classpath (usually in the current *.jar)</li>
    81      *  <li>{@code josmdir://SOME/FILE} file inside josm config directory (since r7058)</li></ul>
     81     *  <li>{@code josmdir://SOME/FILE} file inside josm user data directory (since r7058)</li></ul>
     82     *  <li>{@code josmplugindir://SOME/FILE} file inside josm plugin directory (since r7832)</li></ul>
    8283     */
    8384    public CachedFile(String name) {
     
    9293     *  <li>{@code http://...} a URL. It will be cached on disk.</li></ul>
    9394     *  <li>{@code resource://SOME/FILE} file from the classpath (usually in the current *.jar)</li>
    94      *  <li>{@code josmdir://SOME/FILE} file inside josm config directory (since r7058)</li></ul>
     95     *  <li>{@code josmdir://SOME/FILE} file inside josm user data directory (since r7058)</li></ul>
     96     *  <li>{@code josmplugindir://SOME/FILE} file inside josm plugin directory (since r7832)</li></ul>
    9597     * @return this object
    9698     */
     
    206208                return null;
    207209            } else if (name.startsWith("josmdir://")) {
    208                 cacheFile = new File(Main.pref.getPreferencesDir(), name.substring("josmdir://".length()));
     210                cacheFile = new File(Main.pref.getUserDataDirectory(), name.substring("josmdir://".length()));
     211            } else if (name.startsWith("josmplugindir://")) {
     212                cacheFile = new File(Main.pref.getPluginsDirectory(), name.substring("josmplugindir://".length()));
    209213            } else {
    210214                cacheFile = new File(name);
  • trunk/src/org/openstreetmap/josm/io/GpxExporter.java

    r7518 r7834  
    200200
    201201        if (enable) {
    202             if (copyrightYear.getText().length()==0) {
     202            if (copyrightYear.getText().isEmpty()) {
    203203                String sCopyrightYear = data.getString(META_COPYRIGHT_YEAR);
    204204                if (sCopyrightYear == null) {
     
    207207                copyrightYear.setText(sCopyrightYear);
    208208            }
    209             if (copyright.getText().length()==0) {
     209            if (copyright.getText().isEmpty()) {
    210210                String sCopyright = data.getString(META_COPYRIGHT_LICENSE);
    211211                if (sCopyright == null) {
     
    308308                        break;
    309309                    }
    310                     license += license.length()==0 ? urls[i] : ", "+urls[i];
     310                    license += license.isEmpty() ? urls[i] : ", "+urls[i];
    311311                }
    312312                copyright.setText(license);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java

    r7830 r7834  
    22package org.openstreetmap.josm.io.remotecontrol;
    33
     4import java.io.File;
    45import java.net.InetAddress;
    56import java.net.UnknownHostException;
     
    2829     * @since 7335
    2930     */
    30     public static final BooleanProperty PROP_REMOTECONTROL_HTTPS_ENABLED = new BooleanProperty("remotecontrol.https.enabled", false);
     31    public static final BooleanProperty PROP_REMOTECONTROL_HTTPS_ENABLED = new BooleanProperty(
     32            "remotecontrol.https.enabled", false);
    3133
    3234    /**
     
    7274     */
    7375    public static String getRemoteControlDir() {
    74         return Main.pref.getPreferencesDir() + "remotecontrol/";
     76        return new File(Main.pref.getUserDataDirectory(), "remotecontrol").getAbsolutePath();
    7577    }
    7678
Note: See TracChangeset for help on using the changeset viewer.