1
0
mirror of synced 2025-02-17 18:59:21 +01:00

fix: Add Config/DataHomeDir paths before Config/DataDirs paths (#586)

fix not saving to "XDG_DATA_HOME", when "XDG_DATA_DIRS" is available.  
fix "Content Store" persist in flatpak.

XDG specification specifies how to find config and data directories on
linux systems. Specifically, it says this:

- Data should be written to $XDG_DATA_HOME
- Config should be written to $XDG_CONFIG_HOME
- Data should be read from $XDG_DATA_HOME:$XDG_DATA_DIRS
- Config should be read from $XDG_CONFIG_HOME:$XDG_CONFIG_DIRS
This commit is contained in:
catsout 2022-07-25 18:08:10 +08:00 committed by GitHub
parent 2cb65aac72
commit 3b8b95a22f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -247,8 +247,8 @@ namespace hex::fs {
std::vector<std::fs::path> configDirs = xdg::ConfigDirs();
std::vector<std::fs::path> dataDirs = xdg::DataDirs();
configDirs.push_back(xdg::ConfigHomeDir());
dataDirs.push_back(xdg::DataHomeDir());
configDirs.insert(configDirs.begin(), xdg::ConfigHomeDir());
dataDirs.insert(dataDirs.begin(), xdg::DataHomeDir());
for (auto &dir : dataDirs)
dir = dir / "imhex";