[nostalgia/studio] Make opening a new project close all currently open files

This commit is contained in:
Gary Talent 2022-03-06 14:57:19 -06:00
parent e4f3ec52d0
commit 0b6a36bedc

View File

@ -236,8 +236,11 @@ ox::Error StudioUI::openProject(const ox::String &path) noexcept {
sctx->project = m_project.get();
m_project->fileAdded.connect(m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel);
m_project->fileDeleted.connect(m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel);
m_openFiles.clear();
m_editors.clear();
studio::editConfig<StudioConfig>(m_ctx, [&](StudioConfig *config) {
config->projectPath = path;
config->openFiles.clear();
});
return m_projectExplorer->refreshProjectTreeModel();
}