Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow XDG dirs spec #1613

Closed
wants to merge 0 commits into from
Closed

Follow XDG dirs spec #1613

wants to merge 0 commits into from

Conversation

polirritmico
Copy link

Fix #643. Uses QStandardPaths to get cache, data and config XDG folders. If old folder (e.g. ~/.hydrogen/) is found, use that instead of the XDG paths.

According to https://doc.qt.io/qt-5/qstandardpaths.html this should be the paths returned by QStandardPaths by system (For Linux follow XDG env paths):

QStandardPaths macOs Windows Linux
AppConfigLocation ~/Library/Application Support/hydrogen C:/Users/USER/AppData/Roaming/hydrogen ~/.config/hydrogen
AppLocalDataLocation ~/Library/Application Support/hydrogen C:/Users/USER/AppData/Local/hydrogen ~/.local/share/hydrogen
CacheLocation ~/Library/Caches/hydrogen C:/Users/USER/AppData/Local/hydrogen/cache ~/.cache/hydrogen

The __usr_*_paths are setted outside a function, so QStandardPaths isn't avaliable to get the XDG paths. Also no APPNAME is avaliable until setApplicationName() is called after the Filesystem::check_usr_paths() is used. To avoid this update_usr_paths() is added at the begining of check_usr_paths() to update the correct values from QStandardPaths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

~/.hydrogen does not follow XDG standards
1 participant