1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-26 08:05:45 +01:00

ProjectFileManager::OpenFile returns a pointer to project

This commit is contained in:
Paul Licameli
2021-05-16 09:19:49 -04:00
parent c96d5f12bc
commit 1bed51ac80
3 changed files with 76 additions and 46 deletions

View File

@@ -838,17 +838,15 @@ void ProjectManager::OnCloseWindow(wxCloseEvent & event)
// PRL: I preserve this handler function for an event that was never sent, but
// I don't know the intention.
void ProjectManager::OnOpenAudioFile(wxCommandEvent & event)
{
auto &project = mProject;
auto &window = GetProjectFrame( project );
const wxString &cmd = event.GetString();
if (!cmd.empty())
ProjectFileManager::Get( mProject ).OpenFile(cmd);
window.RequestUserAttention();
if (!cmd.empty()) {
if (auto project = ProjectFileManager::Get( mProject ).OpenFile(cmd)) {
auto &window = GetProjectFrame( *project );
window.RequestUserAttention();
}
}
}
// static method, can be called outside of a project