17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-08 10:31:01 +01:00

refactor: the Sonar remarks on the small fixes taken care of

- the log stops through a flag kept in a function, not a global one
- the messages are put together with std::format
- a vehicle dropped on a trainset in the launcher goes in once the
  trainset is drawn, so the vehicles are gone through with a plain loop
  again; the drop split into a new vehicle and a moved one
- the scenario that can't be opened is caught as the runtime error it
  is, a file name outside of the code page as the system error it is
- a track of an unknown type is left out through the pointer owning it
- the keyword of a track type written out by a function of its own
- the picked node forgotten with ranges::replace_if, the empty
  Forget_Node of the base renderer told why it is empty
- FileCased takes the path it works on
This commit is contained in:
maj00r
2026-11-06 19:54:54 +01:00
parent 8523316006
commit a6778c9fe2
14 changed files with 140 additions and 75 deletions

View File

@@ -2,6 +2,8 @@
#include "scenery_scanner.h"
#include "utilities/Logs.h"
#include <system_error>
scenery_scanner::scenery_scanner(ui::vehicles_bank &bank)
: bank(bank)
{
@@ -17,7 +19,8 @@ void scenery_scanner::scan()
try {
name = path.string();
}
catch (std::exception const &) {
catch (std::system_error const &) {
// a name outside of the code page, which the path can't give as a string on Windows
continue;
}