MCPcopy Create free account
hub / github.com/audacity/audacity / OnCompact

Method OnCompact

src/HistoryWindow.cpp:378–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378void HistoryDialog::OnCompact(wxCommandEvent & WXUNUSED(event))
379{
380 auto &projectFileIO = ProjectFileIO::Get(*mProject);
381
382 projectFileIO.ReopenProject();
383
384 auto baseFile = wxFileName(projectFileIO.GetFileName());
385 auto walFile = wxFileName(projectFileIO.GetFileName() + wxT("-wal"));
386 auto before = baseFile.GetSize() + walFile.GetSize();
387
388 projectFileIO.Compact({}, true);
389
390 auto after = baseFile.GetSize() + walFile.GetSize();
391
392 AudacityMessageBox(
393 XO("Compacting actually freed %s of disk space.")
394 .Format(Internat::FormatSize((before - after).GetValue())),
395 XO("History"));
396}
397
398void HistoryDialog::OnGetURL(wxCommandEvent & WXUNUSED(event))
399{

Callers

nothing calls this directly

Calls 7

GetFunction · 0.85
AudacityMessageBoxFunction · 0.85
ReopenProjectMethod · 0.80
wxFileNameClass · 0.70
GetSizeMethod · 0.45
CompactMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected