Browse Source

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6886
6.0.7
Jon Evans 5 years ago
parent
commit
9ce34102af
  1. 5
      pcbnew/files.cpp
  2. 2
      pcbnew/pcbnew_config.cpp

5
pcbnew/files.cpp

@ -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

2
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();
}
Loading…
Cancel
Save