Make sure projects get created for boards migrated from 5.x

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6886
This commit is contained in:
Jon Evans 2021-03-21 16:21:24 -04:00
parent 8be213e36f
commit 9ce34102af
2 changed files with 4 additions and 3 deletions

View File

@ -641,8 +641,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& 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<wxString>& 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

View File

@ -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();
}