Fix issue moving and renaming projects at the same time (#1620)

This commit is contained in:
AMZN-nggieber
2021-06-28 19:58:00 -07:00
committed by GitHub
parent ccb784d7d5
commit a5e66505a0
@@ -215,6 +215,17 @@ namespace O3DE::ProjectManager
return false;
}
// Check if project path has changed and move it
// Move project first to avoid trying to update settings at the new location before it has been moved there
if (newProjectSettings.m_path != m_projectInfo.m_path)
{
if (!ProjectUtils::MoveProject(m_projectInfo.m_path, newProjectSettings.m_path))
{
QMessageBox::critical(this, tr("Project move failed"), tr("Failed to move project."));
return false;
}
}
// Update project if settings changed
{
auto result = PythonBindingsInterface::Get()->UpdateProject(newProjectSettings);
@@ -225,16 +236,6 @@ namespace O3DE::ProjectManager
}
}
// Check if project path has changed and move it
if (newProjectSettings.m_path != m_projectInfo.m_path)
{
if (!ProjectUtils::MoveProject(m_projectInfo.m_path, newProjectSettings.m_path))
{
QMessageBox::critical(this, tr("Project move failed"), tr("Failed to move project."));
return false;
}
}
if (!newProjectSettings.m_newPreviewImagePath.isEmpty())
{
if (!ProjectUtils::ReplaceFile(