Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 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 (20)

comment:1 Changed 5 years ago by Don-vip

Type: defectenhancement

comment:2 Changed 5 years ago by Don-vip

Milestone: 14.08

comment:3 Changed 5 years ago by Aun Johnsen <lists@…>

Cc: lists@… added

comment:4 Changed 5 years ago by Don-vip

Milestone: 14.0814.09

move imagery cache tickets to next milestone

comment:5 Changed 5 years ago by Don-vip

Keywords: macosx added; mac osx removed

comment:6 Changed 5 years ago by Don-vip

Milestone: 14.0914.10

Move complicated/risky tickets to next milestone.

comment:7 Changed 5 years ago by Don-vip

Milestone: 14.1014.11

Not enough time/resources for these tickets this month.

comment:8 Changed 5 years ago by Don-vip

Milestone: 14.1114.12

comment:9 Changed 5 years ago by Don-vip

In 7829/josm:

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

comment:10 Changed 5 years ago by Don-vip

In 7831/josm:

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

comment:11 Changed 5 years ago by Don-vip

In 7834/josm:

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

comment:12 Changed 5 years ago by Don-vip

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 Changed 5 years ago by Don-vip

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 Changed 5 years ago by bastiK

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).

comment:15 in reply to:  13 Changed 5 years ago by bastiK

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 Changed 5 years ago by Don-vip

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 Changed 5 years ago by bastiK

In 7845/josm:

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

comment:18 Changed 5 years ago by bastiK

Resolution: fixed
Status: closedreopened

TODO: call migration before preferences are loaded

comment:19 Changed 5 years ago by Don-vip

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 Changed 5 years ago by bastiK

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

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.