From 3e2518a27001af4a456e70a0c65a6412326391c2 Mon Sep 17 00:00:00 2001 From: shun_iwasawa Date: Oct 20 2017 13:23:54 +0000 Subject: env file template --- diff --git a/toonz/sources/common/tapptools/tenv.cpp b/toonz/sources/common/tapptools/tenv.cpp index e4c008e..9151016 100644 --- a/toonz/sources/common/tapptools/tenv.cpp +++ b/toonz/sources/common/tapptools/tenv.cpp @@ -171,6 +171,9 @@ public: } TFilePath getEnvFile() { return m_envFile; } + TFilePath getTemplateEnvFile() { + return m_envFile.getParentDir() + TFilePath("template.env"); + } void setApplicationFullName(std::string applicationFullName) { m_applicationFullName = applicationFullName; @@ -326,8 +329,11 @@ void VariableSet::load() { #endif TFilePath fp = EnvGlobals::instance()->getEnvFile(); if (fp == TFilePath()) return; + // if the personal env is not found, then try to find the template + if (!TFileStatus(fp).doesExist()) + fp = EnvGlobals::instance()->getTemplateEnvFile(); Tifstream is(fp); - if (!is) return; + if (!is.isOpen()) return; char buffer[1024]; while (is.getline(buffer, sizeof(buffer))) { char *s = buffer;