1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

- (linux) XDG filesystem support

BIG NOTE TO LINUX USERS
All user data has been moved according to XDG specs:
- Game data (H3 files and mods) and saves: from ~/.vcmi to ~/.local/
- Temporary files, including logs: from ~/.vcmi to ~/.cache/vcmi
- Config files: from ~/.vcmi/config to ~/.config/vcmi

For compatibility VCMI will read game data from ~/.vcmi as well but this
is temporary behavior and will be removed
This commit is contained in:
Ivan Savenko
2014-03-04 14:51:10 +00:00
parent ae55532131
commit 5cbec833c2
7 changed files with 100 additions and 29 deletions

View File

@@ -140,10 +140,11 @@ void CResourceHandler::initialize()
initialLoader = new CFilesystemList;
for (auto & path : VCMIDirs::get().dataPaths())
initialLoader->addLoader(new CFilesystemLoader("", path, 0, true), false);
if (VCMIDirs::get().dataPaths().back() != VCMIDirs::get().userDataPath())
initialLoader->addLoader(new CFilesystemLoader("", VCMIDirs::get().userDataPath(), 0, true), false);
{
if (boost::filesystem::is_directory(path)) // some of system-provided paths may not exist
initialLoader->addLoader(new CFilesystemLoader("", path, 0, true), false);
}
initialLoader->addLoader(new CFilesystemLoader("", VCMIDirs::get().userDataPath(), 0, true), false);
recurseInDir("CONFIG", 0);// look for configs
recurseInDir("DATA", 0); // look for archives