1 commit 6a72fd032405515e468797be91b5a6ebcbbb5fd8
2 Author: Evils <evils.devils@protonmail.com>
3 Date: Wed Nov 23 19:49:13 2022 +0100
5 ensure new projects are writable
7 diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp
8 index 7ee8090858..391514519c 100644
9 --- a/kicad/kicad_manager_frame.cpp
10 +++ b/kicad/kicad_manager_frame.cpp
11 @@ -638,6 +638,12 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxFileName& aProjectFileName,
13 // wxFFile dtor will close the file
16 + if( destFileName.IsOk() && !destFileName.IsFileWritable() )
18 + destFileName.SetPermissions(0644);
24 diff --git a/kicad/project_template.cpp b/kicad/project_template.cpp
25 index bf951fcddb..2bef94326b 100644
26 --- a/kicad/project_template.cpp
27 +++ b/kicad/project_template.cpp
28 @@ -282,6 +282,21 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath, wxString* aEr
32 + else if( !destFile.IsFileWritable() && !destFile.SetPermissions(0644) )
36 + if( !aErrorMsg->empty() )
41 + msg.Printf( _( "Cannot make file writable: '%s'." ), destFile.GetFullPath() );