Enable the user to specify a custom temporary folder to keep the OS's temp folder clean

Change the configuration file to point the temp folder into the OpenSpace folder
Update Ghoul to not overwrite default font files (closes #944)
This commit is contained in:
Alexander Bock
2019-08-22 15:37:08 +02:00
parent d32b4d9f1f
commit 8ce9fde91b
3 changed files with 9 additions and 10 deletions

View File

@@ -78,7 +78,8 @@ Paths = {
LOGS = "${BASE}/logs",
MODULES = "${BASE}/modules",
SCRIPTS = "${BASE}/scripts",
SHADERS = "${BASE}/shaders"
SHADERS = "${BASE}/shaders",
TEMPORARY = "${BASE}/temp"
}
ModuleConfigurations = {

View File

@@ -104,10 +104,7 @@ namespace openspace {
class Scene;
OpenSpaceEngine::OpenSpaceEngine()
: _scene(nullptr)
, _loadingScreen(nullptr)
{
OpenSpaceEngine::OpenSpaceEngine() {
FactoryManager::initialize();
FactoryManager::ref().addFactory(
std::make_unique<ghoul::TemplateFactory<Renderable>>(),
@@ -164,19 +161,20 @@ void OpenSpaceEngine::registerPathTokens() {
ghoul::filesystem::FileSystem::TokenClosingBraces;
LDEBUG(fmt::format("Registering path {}: {}", fullKey, path.second));
const bool override = (fullKey == "${BASE}");
if (override) {
const bool overrideBase = (fullKey == "${BASE}");
if (overrideBase) {
LINFO(fmt::format("Overriding base path with '{}'", path.second));
}
const bool overrideTemporary = (fullKey == "${TEMPORARY}");
using Override = ghoul::filesystem::FileSystem::Override;
FileSys.registerPathToken(
std::move(fullKey),
std::move(path.second),
Override(override)
Override(overrideBase || overrideTemporary)
);
}
LTRACE("OpenSpaceEngine::initialize(end)");
}