add both the (potentially) read-only data from SVN and the appdata path to the config/ search path

(fixes #450)

This was SVN commit r7382.
This commit is contained in:
janwas 2010-03-20 21:37:14 +00:00
parent bf444a8aa1
commit a8b3cc4812
2 changed files with 12 additions and 6 deletions

View File

@ -517,8 +517,11 @@ static void InitVfs(const CmdLineArgs& args)
g_VFS = CreateVfs(cacheSize);
g_VFS->Mount(L"screenshots/", paths.Data()/L"screenshots/");
g_VFS->Mount(L"config/", paths.RData()/L"config/");
g_VFS->Mount(L"profiles/", paths.Config()/L"profiles/");
const fs::wpath readonlyConfig = paths.RData()/L"config/";
g_VFS->Mount(L"config/", readonlyConfig);
if(readonlyConfig != paths.Config())
g_VFS->Mount(L"config/", paths.Config());
g_VFS->Mount(L"profiles/", paths.Config()/L"profiles/"); // deprecated (overlaps the above mount), but profiles/ are still used by JS
g_VFS->Mount(L"cache/", paths.Cache(), VFS_MOUNT_ARCHIVABLE); // (adding XMBs to archive speeds up subsequent reads)
std::vector<CStr> mods = args.GetMultiple("mod");

View File

@ -53,10 +53,13 @@ Paths::Paths(const CmdLineArgs& args)
const char* envHome = getenv("HOME");
debug_assert(envHome);
const fs::wpath home(wstring_from_utf8(envHome));
m_data = AddSlash(XDG_Path("XDG_DATA_HOME", home, home/L".local/share/")/subdirectoryName);
m_config = AddSlash(XDG_Path("XDG_CONFIG_HOME", home, home/L".config/")/subdirectoryName);
m_cache = AddSlash(XDG_Path("XDG_CACHE_HOME", home, home/L".cache/")/subdirectoryName);
m_logs = AddSlash(m_config/L"logs");
const fs::wpath xdgData = XDG_Path("XDG_DATA_HOME", home, home/L".local/share/")/subdirectoryName;
const fs::wpath xdgConfig = XDG_Path("XDG_CONFIG_HOME", home, home/L".config/")/subdirectoryName;
const fs::wpath xdgCache = XDG_Path("XDG_CACHE_HOME", home, home/L".cache/")/subdirectoryName;
m_data = AddSlash(xdgData);
m_cache = AddSlash(xdgCache);
m_config = AddSlash(xdgConfig/L"config");
m_logs = AddSlash(xdgConfig/L"logs");
#endif
}
}