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
+2 -1
View File
@@ -78,7 +78,8 @@ Paths = {
LOGS = "${BASE}/logs", LOGS = "${BASE}/logs",
MODULES = "${BASE}/modules", MODULES = "${BASE}/modules",
SCRIPTS = "${BASE}/scripts", SCRIPTS = "${BASE}/scripts",
SHADERS = "${BASE}/shaders" SHADERS = "${BASE}/shaders",
TEMPORARY = "${BASE}/temp"
} }
ModuleConfigurations = { ModuleConfigurations = {
+6 -8
View File
@@ -104,10 +104,7 @@ namespace openspace {
class Scene; class Scene;
OpenSpaceEngine::OpenSpaceEngine() OpenSpaceEngine::OpenSpaceEngine() {
: _scene(nullptr)
, _loadingScreen(nullptr)
{
FactoryManager::initialize(); FactoryManager::initialize();
FactoryManager::ref().addFactory( FactoryManager::ref().addFactory(
std::make_unique<ghoul::TemplateFactory<Renderable>>(), std::make_unique<ghoul::TemplateFactory<Renderable>>(),
@@ -164,19 +161,20 @@ void OpenSpaceEngine::registerPathTokens() {
ghoul::filesystem::FileSystem::TokenClosingBraces; ghoul::filesystem::FileSystem::TokenClosingBraces;
LDEBUG(fmt::format("Registering path {}: {}", fullKey, path.second)); LDEBUG(fmt::format("Registering path {}: {}", fullKey, path.second));
const bool override = (fullKey == "${BASE}"); const bool overrideBase = (fullKey == "${BASE}");
if (override) { if (overrideBase) {
LINFO(fmt::format("Overriding base path with '{}'", path.second)); LINFO(fmt::format("Overriding base path with '{}'", path.second));
} }
const bool overrideTemporary = (fullKey == "${TEMPORARY}");
using Override = ghoul::filesystem::FileSystem::Override; using Override = ghoul::filesystem::FileSystem::Override;
FileSys.registerPathToken( FileSys.registerPathToken(
std::move(fullKey), std::move(fullKey),
std::move(path.second), std::move(path.second),
Override(override) Override(overrideBase || overrideTemporary)
); );
} }
LTRACE("OpenSpaceEngine::initialize(end)"); LTRACE("OpenSpaceEngine::initialize(end)");
} }