1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-11 08:56:03 +01:00

Simplify public interface of FileHistory

This commit is contained in:
Paul Licameli
2020-05-01 13:07:06 -04:00
parent 3313b33050
commit 66c5b76573
7 changed files with 48 additions and 65 deletions

View File

@@ -778,7 +778,7 @@ bool ProjectFileManager::SaveAs(const wxString & newFileName, bool bWantSaveCopy
success = DoSave(!bOwnsNewAupName || bWantSaveCopy, bWantSaveCopy);
if (success && addToHistory) {
FileHistory::Global().AddFileToHistory( project.GetFileName() );
FileHistory::Global().Append( project.GetFileName() );
}
if (!success || bWantSaveCopy) // bWantSaveCopy doesn't actually change current project.
{
@@ -954,7 +954,7 @@ will be irreversibly overwritten.").Format( fName, fName );
success = DoSave(!bOwnsNewAupName || bWantSaveCopy, bWantSaveCopy, bLossless);
if (success) {
FileHistory::Global().AddFileToHistory( project.GetFileName() );
FileHistory::Global().Append( project.GetFileName() );
if( !bHasPath )
{
gPrefs->Write( wxT("/SaveAs/Path"), filename.GetPath());
@@ -1020,7 +1020,7 @@ bool ProjectFileManager::SaveFromTimerRecording(wxFileName fnFile)
bSuccess = DoSave(true, false);
if (bSuccess) {
FileHistory::Global().AddFileToHistory( project.GetFileName() );
FileHistory::Global().Append( project.GetFileName() );
projectFileIO.SetLoadedFromAup( true );
projectFileIO.SetProjectTitle();
}
@@ -1385,7 +1385,7 @@ void ProjectFileManager::OpenFile(const FilePath &fileNameArg, bool addtohistory
// finished logging errors (if any) before the call to ProjectFSCK()
if (addtohistory)
FileHistory::Global().AddFileToHistory(fileName);
FileHistory::Global().Append(fileName);
}
// Use a finally block here, because there are calls to Save() below which
@@ -1652,7 +1652,7 @@ bool ProjectFileManager::Import(
if (!success)
return false;
FileHistory::Global().AddFileToHistory(fileName);
FileHistory::Global().Append(fileName);
// no more errors, commit
committed = true;