mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 00:20:06 +02:00
AUP3: UP-35 Dirty Project-2 bloat retention
Add compaction to SaveProject for the original file.
This commit is contained in:
parent
f3293fd102
commit
09f7aaad5b
@ -1913,7 +1913,7 @@ bool ProjectFileIO::LoadProject(const FilePath &fileName)
|
|||||||
return true;
|
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
|
// 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.
|
// 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
|
// Autosave no longer needed in original project file
|
||||||
AutoSaveDelete();
|
AutoSaveDelete();
|
||||||
|
|
||||||
// Save the original database connection and try to switch to a new one
|
// Try to vacuum the orignal project file
|
||||||
SaveConnection();
|
Vacuum(lastSaved);
|
||||||
|
|
||||||
|
// Save to close the original project file now
|
||||||
|
CloseProject();
|
||||||
|
|
||||||
// And make it the active project file
|
// And make it the active project file
|
||||||
UseConnection(std::move(newConn), fileName);
|
UseConnection(std::move(newConn), fileName);
|
||||||
|
|
||||||
// The Save was successful, so now it is safe to abandon the
|
|
||||||
// original connection
|
|
||||||
DiscardConnection();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -83,7 +83,7 @@ public:
|
|||||||
|
|
||||||
bool ImportProject(const FilePath &fileName);
|
bool ImportProject(const FilePath &fileName);
|
||||||
bool LoadProject(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);
|
bool SaveCopy(const FilePath& fileName);
|
||||||
|
|
||||||
wxLongLong GetFreeDiskSpace();
|
wxLongLong GetFreeDiskSpace();
|
||||||
|
@ -148,7 +148,7 @@ auto ProjectFileManager::ReadProjectFile( const FilePath &fileName )
|
|||||||
|
|
||||||
if (!projectFileIO.IsTemporary())
|
if (!projectFileIO.IsTemporary())
|
||||||
{
|
{
|
||||||
projectFileIO.SaveProject(fileName);
|
projectFileIO.SaveProject(fileName, nullptr);
|
||||||
resaved = true;
|
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)
|
if (!success)
|
||||||
{
|
{
|
||||||
AudacityMessageBox(
|
AudacityMessageBox(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user