Change datadir to use GetUserConfigDir() #4840
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since there are only stored configuration files it makes sense to use the appropriate folder.
This has the advantage over
GetUserDataDir()
that the XDG-specification can be used on Unix. Also the folder for Mac changes to an equivalent.The following folders will be used with the applications name appended:
XDG_CONFIG_HOME
or~/.config
C:\Users\username\AppData\Roaming
orC:\Documents and Settings\username\Application Data
~/Library/Preferences
If the folder exists at the old location it will be used instead.
These changes require
wxWidgets >= 3.1.1
While
GetUserConfigDir()
usesXDG_CONFIG_HOME
GetUserDataDir()
does still not useXDG_DATA_HOME
so it's required to useGetUserConfigDir()
to take advantage of these changes on Unix.The changes will start working when line 367 in
src/slic3r.cpp
is removed.In my little testing this worked as expected. However I don't have a Mac or Windows so I can't verify this on those.
This fixes #832