From 3a2dbf7786cd1d686251e805f51fea30b096994a Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Thu, 3 Oct 2019 19:27:23 +0200 Subject: [PATCH] Update pleditor path for run from build directory --- common/kiway.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/common/kiway.cpp b/common/kiway.cpp index b2ff4a9a07..af44301f94 100644 --- a/common/kiway.cpp +++ b/common/kiway.cpp @@ -95,6 +95,7 @@ void KIWAY::SetTop( wxFrame* aTop ) const wxString KIWAY::dso_search_path( FACE_T aFaceId ) { const char* name; + const char* dirName; switch( aFaceId ) { @@ -111,6 +112,13 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId ) return wxEmptyString; } + // The subdirectories usually have the same name as the kiface + switch( aFaceId ) + { + case FACE_PL_EDITOR: dirName = "pagelayout_editor"; break; + default: dirName = name + 1; break; + } + #ifndef __WXMAC__ wxString path; @@ -135,8 +143,7 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId ) #ifdef DEBUG // To speed up development, it's sometimes nice to run kicad from inside // the build path. In that case, each program will be in a subdirectory. - // To find the DSOs, we need to go up one directory and then enter a subdirectory - // with the same name as the DSO (without the prefix). + // To find the DSOs, we need to go up one directory and then enter a subdirectory. if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) ) { @@ -147,7 +154,7 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId ) fn.SetName( name ); #else fn.RemoveLastDir(); - fn.AppendDir( name + 1 ); + fn.AppendDir( dirName ); #endif } #endif