mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: Fixed a crash when creating new projects without using global paths and hide UI elements correctly when closing projects
This commit is contained in:
parent
faed5b237b
commit
6ce02ad35f
6 changed files with 27 additions and 37 deletions
|
|
@ -254,24 +254,18 @@ void MainWindow::moveProject (File newProjectFileToOpen, OpenInIDE openInIDE)
|
|||
|
||||
void MainWindow::setProject (std::unique_ptr<Project> newProject)
|
||||
{
|
||||
if (newProject == nullptr)
|
||||
{
|
||||
getProjectContentComponent()->setProject (nullptr);
|
||||
projectNameValue.referTo ({});
|
||||
currentProject = std::move (newProject);
|
||||
|
||||
currentProject.reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
currentProject = std::move (newProject);
|
||||
projectNameValue.referTo (currentProject != nullptr ? currentProject->getProjectValue (Ids::name) : Value());
|
||||
|
||||
if (auto* peer = getPeer())
|
||||
peer->setRepresentedFile (currentProject != nullptr ? currentProject->getFile() : File());
|
||||
|
||||
if (currentProject != nullptr)
|
||||
createProjectContentCompIfNeeded();
|
||||
getProjectContentComponent()->setProject (currentProject.get());
|
||||
projectNameValue.referTo (currentProject->getProjectValue (Ids::name));
|
||||
|
||||
if (auto* peer = getPeer())
|
||||
peer->setRepresentedFile (currentProject->getFile());
|
||||
}
|
||||
if (auto* content = getProjectContentComponent())
|
||||
content->setProject (currentProject.get());
|
||||
|
||||
ProjucerApplication::getCommandManager().commandStatusChanged();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue