From 9ce34102afb53344a1f6bcecd61755ef10f76af7 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 21 Mar 2021 16:21:24 -0400 Subject: [PATCH] Make sure projects get created for boards migrated from 5.x Fixes https://gitlab.com/kicad/code/kicad/-/issues/6886 --- pcbnew/files.cpp | 5 +++-- pcbnew/pcbnew_config.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 2c687fd50c..a7ac28448c 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -641,8 +641,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in // standalone and opening a board that has been moved from its project folder. // For converted projects, we don't want to set the read-only flag because we want a project // to be saved for the new file in case things like netclasses got migrated. - if( !pro.Exists() && !converted ) - Prj().SetReadOnly(); + Prj().SetReadOnly( !pro.Exists() && !converted ); } // Clear the cache footprint list which may be project specific @@ -724,6 +723,8 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in if( loadedBoard->m_LegacyDesignSettingsLoaded ) { + Prj().SetReadOnly( false ); + Prj().GetProjectFile().NetSettings().ResolveNetClassAssignments( true ); // Before we had a copper edge clearance setting, the edge line widths could be used diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index 850034dd54..1ced677489 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -237,6 +237,6 @@ void PCB_EDIT_FRAME::SaveProjectSettings() * The explicit save action in PCB_EDIT_FRAME::SavePcbFile will call SaveProject directly, * so if the user does choose to save the board, the project file will get created then. */ - if( !Prj().IsNullProject() && fn.Exists() ) + if( !Prj().IsNullProject() && ( fn.Exists() || GetBoard()->m_LegacyDesignSettingsLoaded ) ) GetSettingsManager()->SaveProject(); }