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

Method TitleRestorer

src/ProjectFileManager.cpp:1765–1790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1763}
1764
1765TitleRestorer::TitleRestorer(
1766 wxTopLevelWindow &window, AudacityProject &project )
1767{
1768 if( window.IsIconized() )
1769 window.Restore();
1770 window.Raise(); // May help identifying the window on Mac
1771
1772 // Construct this project's name and number.
1773 sProjName = project.GetProjectName();
1774 if ( sProjName.empty() ) {
1775 sProjName = _("<untitled>");
1776 UnnamedCount = std::count_if(
1777 AllProjects{}.begin(), AllProjects{}.end(),
1778 []( const AllProjects::value_type &ptr ){
1779 return ptr->GetProjectName().empty();
1780 }
1781 );
1782 if ( UnnamedCount > 1 ) {
1783 sProjNumber.Printf(
1784 _("[Project %02i] "), project.GetProjectNumber() + 1 );
1785 RefreshAllTitles( true );
1786 }
1787 }
1788 else
1789 UnnamedCount = 0;
1790}
1791
1792TitleRestorer::~TitleRestorer() {
1793 if( UnnamedCount > 1 )

Callers

nothing calls this directly

Calls 7

RefreshAllTitlesFunction · 0.85
IsIconizedMethod · 0.80
RaiseMethod · 0.80
GetProjectNameMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected