OpenToonz - An open-source full-featured 2D animation creation software
C
Immediately save upgraded settings file on project selection
manongjohnda6d38b6c022
diff --git a/toonz/sources/toonz/projectpopup.cpp b/toonz/sources/toonz/projectpopup.cppindex 999468b24..e50248699 100644--- a/toonz/sources/toonz/projectpopup.cpp+++ b/toonz/sources/toonz/projectpopup.cpp@@ -482,9 +482,18 @@ ProjectSettingsPopup::ProjectSettingsPopup() : ProjectPopup(false) {void ProjectSettingsPopup::onChooseProjectChanged(int index) {TFilePath projectFp = m_projectPaths[index];- TProjectManager::instance()->setCurrentProjectPath(projectFp);+ TProjectManager *pm = TProjectManager::instance();+ pm->setCurrentProjectPath(projectFp);+TProject *projectP =TProjectManager::instance()->getCurrentProject().getPointer();++ // In case the project file was upgraded to current version, save it now+ if (projectP->getProjectPath() != projectFp) {+ m_projectPaths[index] = projectP->getProjectPath();+ projectP->save();+ }+updateFieldsFromProject(projectP);IoCmd::saveSceneIfNeeded("Change project");IoCmd::newScene();diff --git a/toonz/sources/toonz/startuppopup.cpp b/toonz/sources/toonz/startuppopup.cppindex ebb8ea9f6..761182fbd 100644--- a/toonz/sources/toonz/startuppopup.cpp+++ b/toonz/sources/toonz/startuppopup.cpp@@ -560,7 +560,16 @@ void StartupPopup::onProjectChanged(int index) {if (m_updating) return;TFilePath projectFp = m_projectPaths[index];- TProjectManager::instance()->setCurrentProjectPath(projectFp);+ TProjectManager *pm = TProjectManager::instance();+ pm->setCurrentProjectPath(projectFp);++ TProjectP currentProject = pm->getCurrentProject();++ // In case the project file was upgraded to current version, save it now+ if (currentProject->getProjectPath() != projectFp) {+ m_projectPaths[index] = currentProject->getProjectPath();+ currentProject->save();+ }IoCmd::newScene();m_pathFld->setPath(TApp::instance()