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

Method SetFileName

libraries/lib-project-file-io/ProjectFileIO.cpp:1609–1645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1607}
1608
1609void ProjectFileIO::SetFileName(const FilePath &fileName)
1610{
1611 auto &project = mProject;
1612
1613 if (!fileName.empty() && fileName != mFileName)
1614 {
1615 BasicUI::CallAfter(
1616 [wThis = weak_from_this()]
1617 {
1618 if (auto pThis = wThis.lock())
1619 pThis->Publish(ProjectFileIOMessage::ProjectFilePathChange);
1620 });
1621 }
1622
1623 if (!mFileName.empty())
1624 {
1625 ActiveProjects::Remove(mFileName);
1626 }
1627
1628 mFileName = fileName;
1629
1630 if (!mFileName.empty())
1631 {
1632 ActiveProjects::Add(mFileName);
1633 }
1634
1635 if (IsTemporary())
1636 {
1637 project.SetProjectName({});
1638 }
1639 else
1640 {
1641 project.SetProjectName(wxFileName(mFileName).GetName());
1642 }
1643
1644 SetProjectTitle();
1645}
1646
1647bool ProjectFileIO::HandleXMLTag(const std::string_view& tag, const AttributesList &attrs)
1648{

Callers 9

ExportProjectMethod · 0.80
CommitMethod · 0.80
LoadProjectMethod · 0.80
ExportProjectMethod · 0.80
ApplyMethod · 0.80
OnExportMethod · 0.80
DoExportMethod · 0.80
DoExportFunction · 0.80

Calls 8

CallAfterFunction · 0.85
AddFunction · 0.85
SetProjectNameMethod · 0.80
wxFileNameClass · 0.50
emptyMethod · 0.45
lockMethod · 0.45
PublishMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected