From 0682d319fb4056ca03ecc5fe40a2ed80e95cb413 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Mon, 3 Feb 2025 18:02:05 -0500 Subject: [PATCH] API: Don't check for busy when not needed see https://gitlab.com/kicad/code/kicad-python/-/issues/11 --- pcbnew/api/api_handler_pcb.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/pcbnew/api/api_handler_pcb.cpp b/pcbnew/api/api_handler_pcb.cpp index c859b541b2..8216085df4 100644 --- a/pcbnew/api/api_handler_pcb.cpp +++ b/pcbnew/api/api_handler_pcb.cpp @@ -666,9 +666,6 @@ std::optional API_HANDLER_PCB::getItemFromDocument( const DocumentSpe HANDLER_RESULT API_HANDLER_PCB::handleGetSelection( const HANDLER_CONTEXT& aCtx ) { - if( std::optional busy = checkForBusy() ) - return tl::unexpected( *busy ); - if( !validateItemHeaderDocument( aCtx.Request.header() ) ) { ApiResponseStatus e; @@ -801,9 +798,6 @@ HANDLER_RESULT API_HANDLER_PCB::handleRemoveFromSelection( HANDLER_RESULT API_HANDLER_PCB::handleGetStackup( const HANDLER_CONTEXT& aCtx ) { - if( std::optional busy = checkForBusy() ) - return tl::unexpected( *busy ); - HANDLER_RESULT documentValidation = validateDocument( aCtx.Request.board() ); if( !documentValidation ) @@ -835,9 +829,6 @@ HANDLER_RESULT API_HANDLER_PCB::handleGetStackup( HANDLER_RESULT API_HANDLER_PCB::handleGetGraphicsDefaults( const HANDLER_CONTEXT& aCtx ) { - if( std::optional busy = checkForBusy() ) - return tl::unexpected( *busy ); - HANDLER_RESULT documentValidation = validateDocument( aCtx.Request.board() ); if( !documentValidation ) @@ -1053,9 +1044,6 @@ HANDLER_RESULT API_HANDLER_PCB::handleInteractiveMoveItems( HANDLER_RESULT API_HANDLER_PCB::handleGetNets( const HANDLER_CONTEXT& aCtx ) { - if( std::optional busy = checkForBusy() ) - return tl::unexpected( *busy ); - HANDLER_RESULT documentValidation = validateDocument( aCtx.Request.board() ); if( !documentValidation ) @@ -1324,6 +1312,9 @@ HANDLER_RESULT API_HANDLER_PCB::handleGetBoardEdi HANDLER_RESULT API_HANDLER_PCB::handleSetBoardEditorAppearanceSettings( const HANDLER_CONTEXT& aCtx ) { + if( std::optional busy = checkForBusy() ) + return tl::unexpected( *busy ); + PCB_DISPLAY_OPTIONS options = frame()->GetDisplayOptions(); KIGFX::PCB_VIEW* view = frame()->GetCanvas()->GetView(); PCBNEW_SETTINGS* editorSettings = frame()->GetPcbNewSettings();