1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 16:40:07 +02:00

Treat save-as of a file to its own path as a simple save

This commit is contained in:
Paul Licameli 2018-01-16 18:41:23 -05:00
parent 133bbd927d
commit 059e186db6

View File

@ -4310,6 +4310,8 @@ bool AudacityProject::Import(const wxString &fileName, WaveTrackArray* pTrackArr
bool AudacityProject::SaveAs(const wxString & newFileName, bool bWantSaveCompressed /*= false*/, bool addToHistory /*= true*/) bool AudacityProject::SaveAs(const wxString & newFileName, bool bWantSaveCompressed /*= false*/, bool addToHistory /*= true*/)
{ {
// This version of SaveAs is invoked only from scripting and does not
// prompt for a file name
wxString oldFileName = mFileName; wxString oldFileName = mFileName;
bool bOwnsNewAupName = mbLoadedFromAup && (mFileName==newFileName); bool bOwnsNewAupName = mbLoadedFromAup && (mFileName==newFileName);
@ -4337,7 +4339,7 @@ bool AudacityProject::SaveAs(const wxString & newFileName, bool bWantSaveCompres
//Don't change the title, unless we succeed. //Don't change the title, unless we succeed.
//SetProjectTitle(); //SetProjectTitle();
success = DoSave(true, bWantSaveCompressed); success = DoSave(!bOwnsNewAupName || bWantSaveCompressed, bWantSaveCompressed);
if (success && addToHistory) { if (success && addToHistory) {
wxGetApp().AddFileToHistory(mFileName); wxGetApp().AddFileToHistory(mFileName);
@ -4436,7 +4438,7 @@ For an audio file that will open in other apps, use 'Export'.\n"),
mFileName = oldFileName; mFileName = oldFileName;
} ); } );
success = DoSave(true, bWantSaveCompressed); success = DoSave(!bOwnsNewAupName || bWantSaveCompressed, bWantSaveCompressed);
if (success) { if (success) {
wxGetApp().AddFileToHistory(mFileName); wxGetApp().AddFileToHistory(mFileName);