+ fixes #0001238: Preferences: set temp files directory
This commit is contained in:
@@ -505,6 +505,16 @@ const char* Application::getExecutableName(void) const
|
||||
return _mConfig["ExeName"].c_str();
|
||||
}
|
||||
|
||||
std::string Application::getTempPath()
|
||||
{
|
||||
return mConfig["AppTempPath"];
|
||||
}
|
||||
|
||||
std::string Application::getTempFileName(const char* FileName)
|
||||
{
|
||||
return Base::FileInfo::getTempFileName(FileName, getTempPath().c_str());
|
||||
}
|
||||
|
||||
std::string Application::getUserAppDataDir()
|
||||
{
|
||||
return mConfig["UserAppData"];
|
||||
@@ -1193,6 +1203,15 @@ void Application::initConfig(int argc, char ** argv)
|
||||
|
||||
LoadParameters();
|
||||
|
||||
// Set application tmp. directory
|
||||
mConfig["AppTempPath"] = Base::FileInfo::getTempPath();
|
||||
std::string tmpPath = _pcUserParamMngr->GetGroup("BaseApp/Preferences/General")->GetASCII("TempPath");
|
||||
Base::FileInfo di(tmpPath);
|
||||
if (di.exists() && di.isDir()) {
|
||||
mConfig["AppTempPath"] = tmpPath + "/";
|
||||
}
|
||||
|
||||
|
||||
// capture python variables
|
||||
SaveEnv("PYTHONPATH");
|
||||
SaveEnv("PYTHONHOME");
|
||||
|
||||
Reference in New Issue
Block a user