Modify

Opened 11 years ago

Closed 10 years ago

Last modified 4 years ago

#10026 closed enhancement (fixed)

Preferences, user data and caches should be stored in the appropriate places on Mac OS X

Reported by: Stereo Owned by: team
Priority: normal Milestone: 14.12
Component: Core Version:
Keywords: macosx Cc: lists@…, cquest

Description

Appropriate Mac OS X places would be ~/Library/Preferences/JOSM/ for preferences, ~/Library/Application Support/JOSM/ for stuff like plug-ins, ~/Library/Caches/JOSM/ for caches.

Old ~/.josm directories, if they exist, should be automatically migrated. If the target directories already exist, the user should get an error.

I don't know if plugins will need to be updated for this.

See https://developer.apple.com/library/mac/qa/qa1170/ for Apple's guidance on this.

Attachments (0)

Change History (21)

comment:1 by Don-vip, 11 years ago

Type: defectenhancement

comment:2 by Don-vip, 11 years ago

Milestone: 14.08

comment:3 by Aun Johnsen <lists@…>, 10 years ago

Cc: lists@… added

comment:4 by Don-vip, 10 years ago

Milestone: 14.0814.09

move imagery cache tickets to next milestone

comment:5 by Don-vip, 10 years ago

Keywords: macosx added; mac osx removed

comment:6 by Don-vip, 10 years ago

Milestone: 14.0914.10

Move complicated/risky tickets to next milestone.

comment:7 by Don-vip, 10 years ago

Milestone: 14.1014.11

Not enough time/resources for these tickets this month.

comment:8 by Don-vip, 10 years ago

Milestone: 14.1114.12

comment:9 by Don-vip, 10 years ago

In 7829/josm:

see #6248, #10026 - use recommended cache directories on Windows and OSX. Linux behaviour is unchanged

comment:10 by Don-vip, 10 years ago

In 7831/josm:

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

comment:11 by Don-vip, 10 years ago

In 7834/josm:

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

comment:12 by Don-vip, 10 years ago

Resolution: fixed
Status: newclosed

In 7835/josm:

fix #10026 - migrate preferences and plugins from old ~/.josm directory to new directories on OSX, then delete old directory

comment:13 by Don-vip, 10 years ago

Cc: cquest added

Guys, can you please test with JOSM latest that all works as expected, including the migration? I haven't tested it.

comment:14 by bastiK, 10 years ago

getDefaultUserDataDirectory() currently points to ~/Library/Application Support/JOSM. The linked document states, that this directory should not be used for irreplaceable user data. So it is not a good location for autosave data. This should go to ~/Library/JOSM.

Comparing the Mac specification to the Linux XDG scheme (see #6664), the cache folder ~/.cache/JOSM corresponds to ~/Library/Caches/JOSM. The preferences folder ~/.config/josm/ corresponds to ~/Library/Preferences/JOSM and the folder for user specific data
~/.local/share/josm corresponds to ~/Library/JOSM.

The Mac folder ~/Library/Application Support/JOSM has no counterpart in XDG. It could be used to store resources like the plugin jar files. For simplicity's sake, I would suggest to ignore this directory and put all application support data in the user data folder (~/Library/JOSM).

in reply to:  13 comment:15 by bastiK, 10 years ago

Replying to Don-vip:

Guys, can you please test with JOSM latest that all works as expected, including the migration? I haven't tested it.

The migration is called after the preferences have been loaded. I guess it is intended to run it earlier.

comment:16 by Don-vip, 10 years ago

I wasn't sure about ~/Library/Application Support/JOSM. I agree ~/Library/JOSM would be simpler.

I thought preferences were loaded after platform prestartup hook? I need to check again.

comment:17 by bastiK, 10 years ago

In 7845/josm:

see #10026 - change user data directory on Mac OSX from ~/Library/Application Support/JOSM to ~/Library/JOSM

comment:18 by bastiK, 10 years ago

Resolution: fixed
Status: closedreopened

TODO: call migration before preferences are loaded

comment:19 by Don-vip, 10 years ago

Resolution: fixed
Status: reopenedclosed

This is already the case, see MainApplication:

        // call the really early hook before we do anything else
        Main.platform.preStartupHook(); // <---- migration called here

        Main.commandLineArgs = Utils.copyArray(argArray);

        if (args.containsKey(Option.VERSION)) {
            System.out.println(Version.getInstance().getAgentString());
            System.exit(0);
        }

        if (args.containsKey(Option.DEBUG) || args.containsKey(Option.TRACE)) {
            // Enable JOSM debug level
            logLevel = 4;
            Main.info(tr("Printing debugging messages to console"));
        }

        if (args.containsKey(Option.TRACE)) {
            // Enable JOSM debug level
            logLevel = 5;
            // Enable debug in OAuth signpost via system preference, but only at trace level
            Preferences.updateSystemProperty("debug", "true");
            Main.info(tr("Enabled detailed debug level (trace)"));
        }

        Main.pref.init(args.containsKey(Option.RESET_PREFERENCES)); // <---- preferences loaded here

comment:20 by bastiK, 10 years ago

Ah okay, I thought Main.initApplicationPreferences would initialize the preferences...

comment:21 by GerdP, 4 years ago

See #20225 for problems introduced with r7834.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.