jobsets: fix Replace button to overwrite existing files (#19900)

(cherry picked from commit 5fb55ccb30)

1ea009e6 jobsets: allow replacing existing jobset files

Co-authored-by: Adrián García <adrgarcia@outlook.com>
This commit is contained in:
Mark Roszko
2025-09-01 01:14:25 +00:00
parent 7e13870ae3
commit 9ca1bf63d9
+12
View File
@@ -224,6 +224,18 @@ int KICAD_MANAGER_CONTROL::NewJobsetFile( const TOOL_EVENT& aEvent )
wxFileName jobsetFn( dlg.GetPath() );
// Check if the file already exists
bool fileExists = wxFileExists( jobsetFn.GetFullPath() );
if( fileExists )
{
// Remove the existing file so that a new one can be created
if( !wxRemoveFile( jobsetFn.GetFullPath() ) )
{
return -1;
}
}
m_frame->OpenJobsFile( jobsetFn.GetFullPath(), true );
return 0;