Skip to content

Commit

Permalink
Projucer: Only resave project if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
reuk committed Nov 25, 2021
1 parent 65a20c6 commit 8092527
Showing 1 changed file with 9 additions and 7 deletions.
Expand Up @@ -512,13 +512,15 @@ void ProjectContentComponent::openInSelectedIDE (bool saveFirst)
return;
}

SafePointer<ProjectContentComponent> safeThis { this };
project->saveAsync (true, true, [safeThis] (Project::SaveResult r)
{
if (safeThis != nullptr && r == Project::SaveResult::savedOk)
safeThis->openInSelectedIDE (false);
});
return;
if (project->hasChangedSinceSaved())
{
project->saveAsync (true, true, [safeThis = SafePointer<ProjectContentComponent> { this }] (Project::SaveResult r)
{
if (safeThis != nullptr && r == Project::SaveResult::savedOk)
safeThis->openInSelectedIDE (false);
});
return;
}
}

project->openProjectInIDE (*selectedExporter);
Expand Down

0 comments on commit 8092527

Please sign in to comment.