When a project is created from a template, PROJECT_TEMPLATE::CreateProject()
renames files on disk (e.g., default.kicad_sch -> newproject.kicad_sch) but
does not update the .kicad_pro file content. This leaves the top_level_sheets
entries referencing the template's filenames, causing "Top level sheet not
found" errors when the new project is opened.
Add a fixup step in PROJECT_FILE::LoadFromFile() that detects stale
top_level_sheets references by checking whether the referenced schematic
files exist on disk. When a referenced file is missing but a file matching
the project name exists, the reference is updated to point to the correct
file.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22951
When performing a project SaveAs, the root sheet's display name (shown
in the hierarchy navigator panel) was not being updated to match the
new project name, even though the filename was correctly renamed.
The fix adds a check in PROJECT_FILE::SaveAs to update the sheet name
when it matches the old project name. This ensures the hierarchy panel
reflects the correct project name after a SaveAs operation.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22853