18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 22:07:55 +01:00

Merge feat/editor-model-turnouts-ui into feat/editor-project-setup

This commit is contained in:
maj00r
2026-11-24 20:11:08 +01:00
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -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;
}
+2 -2
View File
@@ -64,9 +64,9 @@ TEST_CASE("project session: the map opened gets its project, a command tried cha
project::session session;
auto const opened{session.open(folder.root(), "mapa.scn")};
REQUIRE(opened.done);
// nothing to migrate: no file yet, it's written as the scenery is saved
// nothing to migrate, and the map has its project file all the same: the session writes it as the map is opened
CHECK_FALSE(opened.migrated);
CHECK_FALSE(std::filesystem::exists(folder.root() / "mapa.eu07proj"));
CHECK(std::filesystem::exists(folder.root() / "mapa.eu07proj"));
CHECK(session.file() == folder.root() / "mapa.eu07proj");
CHECK(session.network().lines().empty());