Reset the read-only flag when performing Save As

The new location is checked for writing and so we shouldn't keep the old
flag when changing project locations

Fixes https://gitlab.com/kicad/code/kicad/issues/9904
This commit is contained in:
Seth Hillbrand 2021-12-08 17:20:15 -08:00
parent f7fb756f78
commit 1df765af44
1 changed files with 3 additions and 0 deletions

View File

@ -561,6 +561,9 @@ bool PROJECT_FILE::SaveAs( const wxString& aDirectory, const wxString& aFile )
Set( "meta.filename", aFile + "." + ProjectFileExtension );
SetFilename( aFile );
// While performing Save As, we have already checked that we can write to the directory
// so don't carry the previous flag
SetReadOnly( false );
return JSON_SETTINGS::SaveToFile( aDirectory, true );
}