App: add new config key UserConfigPath to store the path to the config files

This commit is contained in:
wmayer
2021-11-09 13:46:26 +01:00
parent 55afa21ba1
commit c83ada98d6
3 changed files with 26 additions and 3 deletions

View File

@@ -1060,6 +1060,11 @@ std::string Application::getTempFileName(const char* FileName)
return Base::FileInfo::getTempFileName(FileName, getTempPath().c_str());
}
std::string Application::getUserConfigDir()
{
return mConfig["UserConfigPath"];
}
std::string Application::getUserAppDataDir()
{
return mConfig["UserAppData"];
@@ -2724,9 +2729,9 @@ void Application::LoadParameters(void)
// Init parameter sets ===========================================================
//
if (mConfig.find("UserParameter") == mConfig.end())
mConfig["UserParameter"] = mConfig["UserAppData"] + "user.cfg";
mConfig["UserParameter"] = mConfig["UserConfigPath"] + "user.cfg";
if (mConfig.find("SystemParameter") == mConfig.end())
mConfig["SystemParameter"] = mConfig["UserAppData"] + "system.cfg";
mConfig["SystemParameter"] = mConfig["UserConfigPath"] + "system.cfg";
// create standard parameter sets
_pcSysParamMngr = new ParameterManager();
@@ -3096,6 +3101,11 @@ void Application::ExtractUserPath()
mConfig["UserAppData"] = pathToString(appData) + PATHSEP;
// User config path (for now equal to UserAppData but will be changed to be XDG compliant)
//
mConfig["UserConfigPath"] = mConfig["UserAppData"];
// Set application tmp. directory
//
boost::filesystem::path cache = findCachePath(mConfig, cacheHome, userTemp);