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

AUP3: UP-35 Dirty Project-2 bloat retention

Add compaction to SaveProject for the original file.
This commit is contained in:
Leland Lucius 2020-07-27 23:16:27 -05:00
parent f3293fd102
commit 09f7aaad5b
3 changed files with 9 additions and 10 deletions

View File

@ -1913,7 +1913,7 @@ bool ProjectFileIO::LoadProject(const FilePath &fileName)
return true;
}
bool ProjectFileIO::SaveProject(const FilePath &fileName)
bool ProjectFileIO::SaveProject(const FilePath &fileName, const std::shared_ptr<TrackList> &lastSaved)
{
// If we're saving to a different file than the current one, then copy the
// current to the new file and make it the active file.
@ -1930,15 +1930,14 @@ bool ProjectFileIO::SaveProject(const FilePath &fileName)
// Autosave no longer needed in original project file
AutoSaveDelete();
// Save the original database connection and try to switch to a new one
SaveConnection();
// Try to vacuum the orignal project file
Vacuum(lastSaved);
// Save to close the original project file now
CloseProject();
// And make it the active project file
UseConnection(std::move(newConn), fileName);
// The Save was successful, so now it is safe to abandon the
// original connection
DiscardConnection();
}
else
{

View File

@ -83,7 +83,7 @@ public:
bool ImportProject(const FilePath &fileName);
bool LoadProject(const FilePath &fileName);
bool SaveProject(const FilePath &fileName);
bool SaveProject(const FilePath &fileName, const std::shared_ptr<TrackList> &lastSaved);
bool SaveCopy(const FilePath& fileName);
wxLongLong GetFreeDiskSpace();

View File

@ -148,7 +148,7 @@ auto ProjectFileManager::ReadProjectFile( const FilePath &fileName )
if (!projectFileIO.IsTemporary())
{
projectFileIO.SaveProject(fileName);
projectFileIO.SaveProject(fileName, nullptr);
resaved = true;
}
@ -302,7 +302,7 @@ bool ProjectFileManager::DoSave(const FilePath & fileName, const bool fromSaveAs
}
}
bool success = projectFileIO.SaveProject(fileName);
bool success = projectFileIO.SaveProject(fileName, mLastSavedTracks);
if (!success)
{
AudacityMessageBox(