From 2cc39bc2be50a4957cf505e0efa3f7724407dc89 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 15 Jan 2025 13:17:58 +0000 Subject: [PATCH] Remove paths from job-success status messages. (They only point to the temp directory anyway.) Fixes https://gitlab.com/kicad/code/kicad/-/issues/19635 --- eeschema/eeschema_jobs_handler.cpp | 8 +++++--- pcbnew/pcbnew_jobs_handler.cpp | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/eeschema/eeschema_jobs_handler.cpp b/eeschema/eeschema_jobs_handler.cpp index 1b431b5a1f..2f917e45c6 100644 --- a/eeschema/eeschema_jobs_handler.cpp +++ b/eeschema/eeschema_jobs_handler.cpp @@ -875,7 +875,7 @@ int EESCHEMA_JOBS_HANDLER::doSymExportSvg( JOB_SYM_EXPORT_SVG* aSvgJob, fn.SetName( filename ); m_reporter->Report( wxString::Format( _( "Plotting symbol '%s' unit %d to '%s'\n" ), - symbol->GetName(), unit, fn.GetFullPath() ), + symbol->GetName(), unit, fn.GetFullName() ), RPT_SEVERITY_ACTION ); // Get the symbol bounding box to fit the plot page to it @@ -1030,7 +1030,8 @@ int EESCHEMA_JOBS_HANDLER::JobSymUpgrade( JOB* aJob ) } else if( fileType != SCH_IO_MGR::SCH_KICAD ) { - m_reporter->Report( _( "Output path must be specified to convert legacy and non-KiCad libraries\n" ), + m_reporter->Report( _( "Output path must be specified to convert legacy and non-KiCad " + "libraries\n" ), RPT_SEVERITY_ERROR ); return CLI::EXIT_CODES::ERR_INVALID_OUTPUT_CONFLICT; @@ -1173,7 +1174,8 @@ int EESCHEMA_JOBS_HANDLER::JobSchErc( JOB* aJob ) return CLI::EXIT_CODES::ERR_INVALID_OUTPUT_CONFLICT; } - m_reporter->Report( wxString::Format( _( "Saved ERC Report to %s\n" ), outPath ), + wxFileName outFile( outPath ); + m_reporter->Report( wxString::Format( _( "Saved ERC Report to %s\n" ), outFile.GetFullName() ), RPT_SEVERITY_INFO ); if( ercJob->m_exitCodeViolations ) diff --git a/pcbnew/pcbnew_jobs_handler.cpp b/pcbnew/pcbnew_jobs_handler.cpp index 837475d80f..0186fcdb32 100644 --- a/pcbnew/pcbnew_jobs_handler.cpp +++ b/pcbnew/pcbnew_jobs_handler.cpp @@ -404,8 +404,9 @@ int PCBNEW_JOBS_HANDLER::JobExportStep( JOB* aJob ) if ( success ) { + wxFileName outFile( outPath ); m_reporter->Report( wxString::Format( _( "Successfully exported VRML to %s" ), - outPath ), + outFile.GetFullName() ), RPT_SEVERITY_INFO ); } else @@ -1040,7 +1041,7 @@ int PCBNEW_JOBS_HANDLER::JobExportGerbers( JOB* aJob ) if( plotter ) { - m_reporter->Report( wxString::Format( _( "Plotted to '%s'.\n" ), fn.GetFullPath() ), + m_reporter->Report( wxString::Format( _( "Plotted to '%s'.\n" ), fn.GetFullName() ), RPT_SEVERITY_ACTION ); LOCALE_IO dummy; PlotBoardLayers( brd, plotter, plotSequence, plotOpts ); @@ -1111,10 +1112,8 @@ int PCBNEW_JOBS_HANDLER::JobExportGencad( JOB* aJob ) if( !exporter.WriteFile( outPath ) ) { - wxString msg; - msg.Printf( _( "Failed to create file '%s'.\n" ), outPath ); - - m_reporter->Report( msg, RPT_SEVERITY_ERROR ); + m_reporter->Report( wxString::Format( _( "Failed to create file '%s'.\n" ), outPath ), + RPT_SEVERITY_ERROR ); return CLI::EXIT_CODES::ERR_UNKNOWN; } @@ -1639,7 +1638,7 @@ int PCBNEW_JOBS_HANDLER::doFpExportSvg( JOB_FP_EXPORT_SVG* aSvgJob, const FOOTPR m_reporter->Report( wxString::Format( _( "Plotting footprint '%s' to '%s'\n" ), aFootprint->GetFPID().GetLibItemName().wx_str(), - outputFile.GetFullPath() ), + outputFile.GetFullName() ), RPT_SEVERITY_ACTION ); @@ -1826,7 +1825,8 @@ int PCBNEW_JOBS_HANDLER::JobExportDrc( JOB* aJob ) return CLI::EXIT_CODES::ERR_INVALID_OUTPUT_CONFLICT; } - m_reporter->Report( wxString::Format( _( "Saved DRC Report to %s\n" ), outPath ), + wxFileName outFile( outPath ); + m_reporter->Report( wxString::Format( _( "Saved DRC Report to %s\n" ), outFile.GetFullName() ), RPT_SEVERITY_INFO ); if( drcJob->m_exitCodeViolations ) @@ -1873,7 +1873,6 @@ int PCBNEW_JOBS_HANDLER::JobExportIpc2581( JOB* aJob ) return CLI::EXIT_CODES::ERR_INVALID_OUTPUT_CONFLICT; } - std::map props; props["units"] = job->m_units == JOB_EXPORT_PCB_IPC2581::IPC2581_UNITS::MILLIMETERS ? "mm" : "inch"; @@ -1895,7 +1894,8 @@ int PCBNEW_JOBS_HANDLER::JobExportIpc2581( JOB* aJob ) catch( const IO_ERROR& ioe ) { m_reporter->Report( wxString::Format( _( "Error generating IPC2581 file '%s'.\n%s" ), - job->m_filename, ioe.What() ), + job->m_filename, + ioe.What() ), RPT_SEVERITY_ERROR ); wxRemoveFile( tempFile );