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

AUP3: Small cleanup

This commit is contained in:
Leland Lucius 2020-08-01 21:40:54 -05:00
parent 913c41e6e8
commit c29c6b1b15

View File

@ -162,8 +162,9 @@ void OnCompact(const CommandContext &context)
int64_t total = projectFileIO.GetTotalUsage();
int64_t used = projectFileIO.GetCurrentUsage(currentTracks);
auto before = wxFileName(projectFileIO.GetFileName()).GetSize() +
wxFileName(projectFileIO.GetFileName() + wxT("-wal")).GetSize();
auto baseFile = wxFileName(projectFileIO.GetFileName());
auto walFile = wxFileName(projectFileIO.GetFileName() + wxT("-wal"));
auto before = baseFile.GetSize() + walFile.GetSize();
int id = AudacityMessageBox(
XO("Compacting this project will free up disk space by removing unused bytes within the file.\n\n"
@ -179,11 +180,8 @@ void OnCompact(const CommandContext &context)
XO("Compact Project"),
wxYES_NO);
if (id == wxNO)
if (id == wxYES)
{
return;
}
ProjectHistory::Get(project)
.PushState(XO("Compacted project file"), XO("Compact"), UndoPush::CONSOLIDATE);
@ -194,8 +192,7 @@ void OnCompact(const CommandContext &context)
projectFileIO.Compact(currentTracks, true);
auto after = wxFileName(projectFileIO.GetFileName()).GetSize() +
wxFileName(projectFileIO.GetFileName() + wxT("-wal")).GetSize();
auto after = baseFile.GetSize() + walFile.GetSize();
AudacityMessageBox(
XO("Compacting actually freed %s of disk space.")
@ -203,6 +200,9 @@ void OnCompact(const CommandContext &context)
XO("Compact Project"));
}
currentTracks.reset();
}
void OnSave(const CommandContext &context )
{
auto &project = context.project;