diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 1008d781bd..c0cbc9f5ac 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -747,7 +747,8 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in // compiled. Raise(); - SetBoard( loadedBoard ); + // Skip (possibly expensive) connectivity build here; we build it below after load + SetBoard( loadedBoard, false ); if( GFootprintList.GetCount() == 0 ) GFootprintList.ReadCacheFromFile( Prj().GetProjectPath() + "fp-info-cache" ); @@ -911,7 +912,6 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in // Rebuild list of nets (full ratsnest rebuild) GetBoard()->BuildConnectivity(); - Compile_Ratsnest( true ); // Load project settings after setting up board; some of them depend on the nets list LoadProjectSettings(); diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 6545b5a1ad..1d5e0010ba 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -387,7 +387,7 @@ PCB_EDIT_FRAME::~PCB_EDIT_FRAME() } -void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard ) +void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard, bool aBuildConnectivity ) { if( m_pcb ) m_pcb->ClearProject(); @@ -395,7 +395,9 @@ void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard ) PCB_BASE_EDIT_FRAME::SetBoard( aBoard ); aBoard->SetProject( &Prj() ); - aBoard->GetConnectivity()->Build( aBoard ); + + if( aBuildConnectivity ) + aBoard->GetConnectivity()->Build( aBoard ); // reload the drawing-sheet SetPageSettings( aBoard->GetPageSettings() ); diff --git a/pcbnew/pcb_edit_frame.h b/pcbnew/pcb_edit_frame.h index a0b88a0585..c74dd52b81 100644 --- a/pcbnew/pcb_edit_frame.h +++ b/pcbnew/pcb_edit_frame.h @@ -398,7 +398,12 @@ public: bool Clear_Pcb( bool aQuery, bool aFinal = false ); ///< @copydoc PCB_BASE_FRAME::SetBoard() - void SetBoard( BOARD* aBoard ) override; + void SetBoard( BOARD* aBoard ) override + { + SetBoard( aBoard, true ); + } + + void SetBoard( BOARD* aBoard, bool aBuildConnectivity ); ///< @copydoc PCB_BASE_FRAME::GetModel() BOARD_ITEM_CONTAINER* GetModel() const override;