mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-02 05:02:45 +01:00
fix(editor): a map opened on the model gets its project file also with nothing to migrate
open_project() writes no project file when there are no //$ lines to migrate (#461), but the editing on the model relies on the map having its project file from the start: the self-test cases m_1_lay_managed and ps_2_setup_project failed with it absent. session::open() writes it when it isn't there.
This commit is contained in:
@@ -59,6 +59,10 @@ session::open_result session::open(std::filesystem::path const &Folder, std::str
|
||||
m_model = layout::model{m_project.network};
|
||||
m_open = true;
|
||||
result.done = true;
|
||||
// a map edited on the model has its project file from the start, also with nothing to migrate, of which open_project() writes none
|
||||
if (std::error_code missing; false == std::filesystem::exists(file(), missing))
|
||||
if (std::string error; false == save(error))
|
||||
result.notes.push_back("the project file isn't written: " + error);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user