mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Ensure archives without ext are given .zip
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21423
This commit is contained in:
parent
1166cacc64
commit
2ded7b87af
@ -24,6 +24,7 @@
|
||||
#include <wx/zipstrm.h>
|
||||
#include <gestfich.h>
|
||||
#include <common.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
|
||||
JOBS_OUTPUT_ARCHIVE::JOBS_OUTPUT_ARCHIVE() :
|
||||
JOBS_OUTPUT_HANDLER(),
|
||||
@ -52,6 +53,8 @@ bool JOBS_OUTPUT_ARCHIVE::HandleOutputs( const wxString& baseTempPath, PROJECT*
|
||||
if( outputPath.StartsWith( "~" ) )
|
||||
outputPath.Replace( "~", wxGetHomeDir(), false );
|
||||
|
||||
outputPath = EnsureFileExtension( outputPath, FILEEXT::ArchiveFileExtension );
|
||||
|
||||
wxFFileOutputStream ostream( outputPath );
|
||||
|
||||
if( !ostream.IsOk() ) // issue to create the file. Perhaps not writable dir
|
||||
|
@ -104,7 +104,19 @@ void DIALOG_DESTINATION::onOutputPathBrowseClicked(wxCommandEvent& event)
|
||||
if( dlg.ShowModal() != wxID_OK )
|
||||
return;
|
||||
|
||||
m_textCtrlOutputPath->SetValue( dlg.GetPath() );
|
||||
wxString path = dlg.GetPath();
|
||||
|
||||
if( m_destination->m_type == JOBSET_DESTINATION_T::ARCHIVE )
|
||||
{
|
||||
wxFileName fn( path );
|
||||
|
||||
if( fn.GetExt().IsEmpty() )
|
||||
fn.SetExt( FILEEXT::ArchiveFileExtension );
|
||||
|
||||
path = fn.GetFullPath();
|
||||
}
|
||||
|
||||
m_textCtrlOutputPath->SetValue( path );
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user