From a12c3efeb1809ac09c46facc8dc88a3695693429 Mon Sep 17 00:00:00 2001 From: Teddy Date: Mon, 28 Jul 2025 10:59:28 +0200 Subject: [PATCH] Clean up code --- DataModel/Accessory.cpp | 5 ++--- DataModel/Accessory.h | 8 ++++---- DataModel/AccessoryBase.cpp | 3 +-- DataModel/AccessoryBase.h | 4 ++-- DataModel/Cluster.cpp | 12 +++++------- DataModel/Cluster.h | 7 +++---- DataModel/Feedback.cpp | 5 ++--- DataModel/Feedback.h | 2 +- DataModel/HardwareHandle.cpp | 3 +-- DataModel/HardwareHandle.h | 2 +- DataModel/Layer.h | 8 ++++---- DataModel/LayoutItem.cpp | 7 +++---- DataModel/LayoutItem.h | 10 +++++----- DataModel/LockableItem.cpp | 3 +-- DataModel/LockableItem.h | 3 +-- DataModel/Loco.cpp | 8 ++++---- DataModel/Loco.h | 2 +- DataModel/LocoBase.cpp | 7 +++---- DataModel/LocoBase.h | 4 ++-- DataModel/LocoFunctions.cpp | 3 +-- DataModel/LocoFunctions.h | 2 +- DataModel/MultipleUnit.cpp | 8 ++++---- DataModel/MultipleUnit.h | 2 +- DataModel/Object.cpp | 7 +++---- DataModel/Object.h | 4 ++-- DataModel/ObjectIdentifier.cpp | 23 +++++++++++------------ DataModel/ObjectIdentifier.h | 2 +- DataModel/Relation.cpp | 27 +++++++++++++-------------- DataModel/Relation.h | 2 +- DataModel/Route.cpp | 8 ++++---- DataModel/Route.h | 3 ++- DataModel/Serializable.h | 11 +++++------ DataModel/Signal.cpp | 21 ++------------------- DataModel/Signal.h | 18 ++++++++++++++---- DataModel/Switch.cpp | 5 ++--- DataModel/Switch.h | 4 ++-- DataModel/Text.cpp | 5 ++--- DataModel/Text.h | 2 +- DataModel/Track.cpp | 14 ++++++-------- DataModel/Track.h | 2 +- Manager.cpp | 1 + Server/Web/HtmlTagRoute.cpp | 4 +++- Server/Web/HtmlTagTrack.cpp | 4 ++-- Server/Web/WebClientRoute.cpp | 6 +++--- Server/Web/WebClientText.cpp | 8 ++++---- Server/Web/WebClientText.h | 1 - Server/Web/WebClientTrack.h | 2 -- Server/Web/WebServer.h | 4 ++-- Storage/StorageHandler.cpp | 28 ++++++++++++++++++---------- html/style.css | 6 ++++-- 50 files changed, 162 insertions(+), 178 deletions(-) Index: railcontrol/DataModel/Accessory.cpp =================================================================== --- railcontrol.orig/DataModel/Accessory.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Accessory.cpp 2025-11-24 15:27:11.429856087 +0100 @@ -39,14 +39,14 @@ return str; } - bool Accessory::Deserialize(const std::string& serialized) + void Accessory::Deserialize(const std::string& serialized) { map arguments; ParseArguments(serialized, arguments); string objectType = Utils::Utils::GetStringMapEntry(arguments, "objectType"); if (objectType.compare("Accessory") != 0) { - return false; + return; } AccessoryBase::Deserialize(arguments); LayoutItem::Deserialize(arguments); @@ -55,7 +55,6 @@ SetWidth(Width1); SetHeight(Height1); SetVisible(VisibleYes); - return true; } Accessory& Accessory::operator=(const Hardware::AccessoryCacheEntry& accessory) Index: railcontrol/DataModel/Accessory.h =================================================================== --- railcontrol.orig/DataModel/Accessory.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Accessory.h 2025-11-24 15:27:11.429922531 +0100 @@ -63,20 +63,20 @@ { } - virtual ObjectType GetObjectType() const override + inline ObjectType GetObjectType() const override { return ObjectTypeAccessory; } - virtual std::string GetLayoutType() const override + inline std::string GetLayoutType() const override { return Languages::GetText(Languages::TextAccessory); } - virtual std::string Serialize() const override; + std::string Serialize() const override; using HardwareHandle::Deserialize; - virtual bool Deserialize(const std::string& serialized) override; + void Deserialize(const std::string& serialized) override; Accessory& operator=(const Hardware::AccessoryCacheEntry& accessory); Index: railcontrol/DataModel/AccessoryBase.cpp =================================================================== --- railcontrol.orig/DataModel/AccessoryBase.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/AccessoryBase.cpp 2025-11-24 15:27:11.429973149 +0100 @@ -42,7 +42,7 @@ return str; } - bool AccessoryBase::Deserialize(const map& arguments) + void AccessoryBase::Deserialize(const map& arguments) { HardwareHandle::Deserialize(arguments); accessoryType = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "type")); @@ -52,7 +52,6 @@ lastUsed = Utils::Utils::GetIntegerMapEntry(arguments, "lastused", 0); counter = Utils::Utils::GetIntegerMapEntry(arguments, "counter", 0); matchKey = Utils::Utils::GetStringMapEntry(arguments, "matchkey"); - return true; } AccessoryState AccessoryBase::CalculateInvertedAccessoryState(const AccessoryState state) const Index: railcontrol/DataModel/AccessoryBase.h =================================================================== --- railcontrol.orig/DataModel/AccessoryBase.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/AccessoryBase.h 2025-11-24 15:27:11.430063726 +0100 @@ -115,7 +115,7 @@ class AccessoryBase : public HardwareHandle { public: - AccessoryBase() + inline AccessoryBase() : HardwareHandle(), accessoryType(AccessoryTypeDefault), accessoryState(AccessoryStateOff), @@ -201,7 +201,7 @@ protected: virtual std::string Serialize() const; - virtual bool Deserialize(const std::map& arguments); + virtual void Deserialize(const std::map& arguments); private: AccessoryType accessoryType; Index: railcontrol/DataModel/Cluster.cpp =================================================================== --- railcontrol.orig/DataModel/Cluster.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Cluster.cpp 2025-11-24 15:27:11.430119357 +0100 @@ -19,12 +19,10 @@ */ #include -#include #include "DataModel/Cluster.h" #include "DataModel/LockableItem.h" #include "DataModel/Relation.h" -#include "DataModel/Signal.h" #include "DataModel/Track.h" #include "Manager.h" #include "Utils/Utils.h" @@ -45,17 +43,17 @@ return str; } - bool Cluster::Deserialize(const string& serialized) + void Cluster::Deserialize(const string& serialized) { map arguments; ParseArguments(serialized, arguments); - Object::Deserialize(arguments); - if (!arguments.count("objectType") || arguments.at("objectType").compare("Cluster") != 0) + string objectType = Utils::Utils::GetStringMapEntry(arguments, "objectType"); + if (objectType.compare("Cluster") != 0) { - return false; + return; } + Object::Deserialize(arguments); orientation = static_cast(Utils::Utils::GetBoolMapEntry(arguments, "orientation", OrientationRight)); - return true; } bool Cluster::CanSetLocoBaseOrientationUnlocked(const Orientation orientation, const ObjectIdentifier& locoBaseIdentifier) Index: railcontrol/DataModel/Cluster.h =================================================================== --- railcontrol.orig/DataModel/Cluster.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Cluster.h 2025-11-24 15:27:11.430173426 +0100 @@ -32,19 +32,18 @@ namespace DataModel { class Relation; - class Signal; class Track; class Cluster : public Object { public: - Cluster(__attribute__((unused)) Manager* manager, const ClusterID clusterID) + inline Cluster(__attribute__((unused)) Manager* manager, const ClusterID clusterID) : Object(clusterID), orientation(OrientationRight) { } - Cluster(const std::string& serialized) + inline Cluster(const std::string& serialized) : Object(ClusterNone), orientation(OrientationRight) { @@ -62,7 +61,7 @@ } std::string Serialize() const override; - bool Deserialize(const std::string& serialized) override; + void Deserialize(const std::string& serialized) override; inline bool CanSetLocoBaseOrientation(const Orientation orientation, const ObjectIdentifier& locoBaseIdentifier) Index: railcontrol/DataModel/Feedback.cpp =================================================================== --- railcontrol.orig/DataModel/Feedback.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Feedback.cpp 2025-11-24 15:27:11.430226583 +0100 @@ -45,14 +45,14 @@ return str; } - bool Feedback::Deserialize(const string& serialized) + void Feedback::Deserialize(const string& serialized) { map arguments; ParseArguments(serialized, arguments); string objectType = Utils::Utils::GetStringMapEntry(arguments, "objectType"); if (objectType.compare("Feedback") != 0) { - return false; + return; } LayoutItem::Deserialize(arguments); SetHeight(Height1); @@ -64,7 +64,6 @@ inverted = Utils::Utils::GetBoolMapEntry(arguments, "inverted", false); stateCounter = Utils::Utils::GetBoolMapEntry(arguments, "state", FeedbackStateFree) ? MaxStateCounter : 0; matchKey = Utils::Utils::GetStringMapEntry(arguments, "matchkey"); - return true; } void Feedback::SetState(const FeedbackState newState) Index: railcontrol/DataModel/Feedback.h =================================================================== --- railcontrol.orig/DataModel/Feedback.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Feedback.h 2025-11-24 15:27:11.430274683 +0100 @@ -79,7 +79,7 @@ std::string Serialize() const override; - bool Deserialize(const std::string& serialized) override; + void Deserialize(const std::string& serialized) override; inline bool IsInUse() const { Index: railcontrol/DataModel/HardwareHandle.cpp =================================================================== --- railcontrol.orig/DataModel/HardwareHandle.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/HardwareHandle.cpp 2025-11-24 15:27:11.430319385 +0100 @@ -36,12 +36,11 @@ return str; } - bool HardwareHandle::Deserialize(const map& arguments) + void HardwareHandle::Deserialize(const map& arguments) { controlID = Utils::Utils::GetIntegerMapEntry(arguments, "controlID", ControlIdNone); protocol = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "protocol", ProtocolNone)); address = Utils::Utils::GetIntegerMapEntry(arguments, "address"); serverAddress = static_cast
(Utils::Utils::GetIntegerMapEntry(arguments, "serveraddress", AddressNone)); - return true; } } // namespace DataModel Index: railcontrol/DataModel/HardwareHandle.h =================================================================== --- railcontrol.orig/DataModel/HardwareHandle.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/HardwareHandle.h 2025-11-24 15:27:11.430364845 +0100 @@ -101,7 +101,7 @@ protected: virtual std::string Serialize() const; - virtual bool Deserialize(const std::map& arguments); + virtual void Deserialize(const std::map& arguments); private: ControlID controlID; Index: railcontrol/DataModel/Layer.h =================================================================== --- railcontrol.orig/DataModel/Layer.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Layer.h 2025-11-24 15:27:11.430411723 +0100 @@ -33,23 +33,23 @@ class Layer : public Object { public: - Layer(const std::string& serialized) + inline Layer(const std::string& serialized) : Object() { Object::Deserialize(serialized); } - Layer(__attribute__((unused)) Manager* manager, const LayerID layerID) + inline Layer(__attribute__((unused)) Manager* manager, const LayerID layerID) : Object(layerID) { } - virtual std::string Serialize() const + inline std::string Serialize() const override { return "objectType=Layer;" + Object::Serialize(); } - ObjectType GetObjectType() const + inline ObjectType GetObjectType() const override { return ObjectTypeLayer; } Index: railcontrol/DataModel/LayoutItem.cpp =================================================================== --- railcontrol.orig/DataModel/LayoutItem.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/LayoutItem.cpp 2025-11-24 15:27:11.430490433 +0100 @@ -111,14 +111,14 @@ return ss.str(); } - bool LayoutItem::Deserialize(const std::string& serialized) + void LayoutItem::Deserialize(const std::string& serialized) { map arguments; ParseArguments(serialized, arguments); - return Deserialize(arguments); + Deserialize(arguments); } - bool LayoutItem::Deserialize(const map& arguments) + void LayoutItem::Deserialize(const map& arguments) { Object::Deserialize(arguments); visible = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "visible")); @@ -136,7 +136,6 @@ { rotation = Rotation0; } - return true; } std::string LayoutItem::Rotation(LayoutRotation rotation) Index: railcontrol/DataModel/LayoutItem.h =================================================================== --- railcontrol.orig/DataModel/LayoutItem.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/LayoutItem.h 2025-11-24 15:27:11.430568160 +0100 @@ -60,7 +60,7 @@ inline LayoutRotation& operator=(const int rotation) { - this->rotation = (rotation > RotationNotRelevant || rotation < Rotation0) ? Rotation0 : static_cast(rotation); + this->rotation = static_cast(rotation & 0x03); return *this; } @@ -148,7 +148,7 @@ virtual bool CheckPositionFree(const LayoutPosition posX, const LayoutPosition posY, const LayoutPosition posZ); virtual std::string Serialize() const override; - virtual bool Deserialize(const std::string& serialized) override; + virtual void Deserialize(const std::string& serialized) override; virtual std::string GetLayoutType() const = 0; inline void SetVisible(const Visible visible) @@ -195,12 +195,12 @@ const LayoutPosition y, const LayoutPosition z) const { - return posX == x && posY == y && posZ == z; + return (posX == x) && (posY == y) && (posZ == z); } inline bool IsVisibleOnLayer(const LayoutPosition z) const { - return posZ == z && visible == VisibleYes; + return (posZ == z) && (visible == VisibleYes); } inline void SetWidth(const LayoutItemSize width) @@ -246,7 +246,7 @@ static std::string Rotation(LayoutRotation rotation); protected: - virtual bool Deserialize(const std::map& arguments) override; + virtual void Deserialize(const std::map& arguments) override; private: Visible visible; Index: railcontrol/DataModel/LockableItem.cpp =================================================================== --- railcontrol.orig/DataModel/LockableItem.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/LockableItem.cpp 2025-11-24 15:27:11.430643463 +0100 @@ -35,14 +35,13 @@ + ";locobasetype=" + std::to_string(locoBaseIdentifier.GetObjectType()); } - bool LockableItem::Deserialize(const map arguments) + void LockableItem::Deserialize(const map arguments) { const LocoID locoID = Utils::Utils::GetIntegerMapEntry(arguments, "locoID", LocoNone); // FIXME: Remove later: 2024-02-08 locoBaseIdentifier.SetObjectID(Utils::Utils::GetIntegerMapEntry(arguments, "locobaseid", locoID)); locoBaseIdentifier.SetObjectType(static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "locobasetype", ObjectTypeLoco))); lockState = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "lockState", LockStateFree)); // FIXME: Remove later: 2024-02-08 lockState = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "lockstate", lockState)); - return true; } bool LockableItem::Reserve(Logger::Logger* logger, const ObjectIdentifier& locoBaseIdentifier) Index: railcontrol/DataModel/LockableItem.h =================================================================== --- railcontrol.orig/DataModel/LockableItem.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/LockableItem.h 2025-11-24 15:27:11.430691717 +0100 @@ -48,8 +48,7 @@ virtual ~LockableItem() {}; std::string Serialize() const; - bool Deserialize(const std::map arguments); - + void Deserialize(const std::map arguments); inline const ObjectIdentifier& GetLocoBase() const { Index: railcontrol/DataModel/Loco.cpp =================================================================== --- railcontrol.orig/DataModel/Loco.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Loco.cpp 2025-11-24 15:27:11.430737424 +0100 @@ -41,16 +41,16 @@ return str; } - bool Loco::Deserialize(const std::string& serialized) + void Loco::Deserialize(const std::string& serialized) { map arguments; ParseArguments(serialized, arguments); - if (!arguments.count("objectType") || arguments.at("objectType").compare("Loco") != 0) + string objectType = Utils::Utils::GetStringMapEntry(arguments, "objectType"); + if (objectType.compare("Loco") != 0) { - return false; + return; } LocoBase::Deserialize(arguments); - return true; } Loco& Loco::operator=(const Hardware::LocoCacheEntry& loco) Index: railcontrol/DataModel/Loco.h =================================================================== --- railcontrol.orig/DataModel/Loco.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Loco.h 2025-11-24 15:27:11.430783654 +0100 @@ -62,7 +62,7 @@ std::string Serialize() const override; - bool Deserialize(const std::string& serialized) override; + void Deserialize(const std::string& serialized) override; Loco& operator=(const Hardware::LocoCacheEntry& loco); }; Index: railcontrol/DataModel/LocoBase.cpp =================================================================== --- railcontrol.orig/DataModel/LocoBase.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/LocoBase.cpp 2025-11-24 15:27:11.430864197 +0100 @@ -71,14 +71,14 @@ return str; } - bool LocoBase::Deserialize(const std::string& serialized) + void LocoBase::Deserialize(const std::string& serialized) { map arguments; ParseArguments(serialized, arguments); - return LocoBase::Deserialize(arguments); + LocoBase::Deserialize(arguments); } - bool LocoBase::Deserialize(const std::map& arguments) + void LocoBase::Deserialize(const std::map& arguments) { Object::Deserialize(arguments); HardwareHandle::Deserialize(arguments); @@ -95,7 +95,6 @@ propulsion = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "propulsion", PropulsionUnknown)); trainType = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "type", TrainTypeUnknown)); matchKey = Utils::Utils::GetStringMapEntry(arguments, "matchkey"); - return true; } bool LocoBase::SetTrack(const TrackID trackID) Index: railcontrol/DataModel/LocoBase.h =================================================================== --- railcontrol.orig/DataModel/LocoBase.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/LocoBase.h 2025-11-24 15:27:11.430946435 +0100 @@ -118,9 +118,9 @@ std::string Serialize() const override; - bool Deserialize(const std::string& serialized) override; + void Deserialize(const std::string& serialized) override; - bool Deserialize(const std::map& arguments) override; + void Deserialize(const std::map& arguments) override; virtual void SetName(const std::string& name) override { Index: railcontrol/DataModel/LocoFunctions.cpp =================================================================== --- railcontrol.orig/DataModel/LocoFunctions.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/LocoFunctions.cpp 2025-11-24 15:27:11.431085177 +0100 @@ -103,7 +103,7 @@ return out; } - bool LocoFunctions::Deserialize(const std::string& serialized) + void LocoFunctions::Deserialize(const std::string& serialized) { std::deque functionsSerialized; Utils::Utils::SplitString(serialized, "f", functionsSerialized); @@ -136,7 +136,6 @@ entries[nr].timer = static_cast(Utils::Integer::StringToInteger(functionTexts.front(), 0)); functionTexts.pop_front(); } - return true; } std::string LocoFunctions::GetLocoFunctionIcon(const LocoFunctionNr nr, const LocoFunctionIcon icon) Index: railcontrol/DataModel/LocoFunctions.h =================================================================== --- railcontrol.orig/DataModel/LocoFunctions.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/LocoFunctions.h 2025-11-24 15:27:11.431210806 +0100 @@ -261,7 +261,7 @@ std::string Serialize() const override; - bool Deserialize(const std::string& serialized) override; + void Deserialize(const std::string& serialized) override; inline LocoFunctionIcon GetFunctionIcon(const LocoFunctionNr nr) const { Index: railcontrol/DataModel/MultipleUnit.cpp =================================================================== --- railcontrol.orig/DataModel/MultipleUnit.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/MultipleUnit.cpp 2025-11-24 15:27:11.431264994 +0100 @@ -36,16 +36,16 @@ return str; } - bool MultipleUnit::Deserialize(const std::string& serialized) + void MultipleUnit::Deserialize(const std::string& serialized) { map arguments; ParseArguments(serialized, arguments); - if (!arguments.count("objectType") || arguments.at("objectType").compare("MultipleUnit") != 0) + string objectType = Utils::Utils::GetStringMapEntry(arguments, "objectType"); + if (objectType.compare("MultipleUnit") != 0) { - return false; + return; } LocoBase::Deserialize(arguments); - return true; } void MultipleUnit::CalculatePropulsion() Index: railcontrol/DataModel/MultipleUnit.h =================================================================== --- railcontrol.orig/DataModel/MultipleUnit.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/MultipleUnit.h 2025-11-24 15:27:11.431310274 +0100 @@ -58,7 +58,7 @@ std::string Serialize() const override; - bool Deserialize(const std::string& serialized) override; + void Deserialize(const std::string& serialized) override; void CalculatePropulsion(); Index: railcontrol/DataModel/Object.cpp =================================================================== --- railcontrol.orig/DataModel/Object.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Object.cpp 2025-11-24 15:27:11.431383120 +0100 @@ -35,18 +35,17 @@ return "objectID=" + std::to_string(objectID) + ";name=" + Utils::Utils::UrlEncode(name); } - bool Object::Deserialize(const std::string& serialized) + void Object::Deserialize(const std::string& serialized) { map arguments; ParseArguments(serialized, arguments); - return Object::Deserialize(arguments); + Object::Deserialize(arguments); } - bool Object::Deserialize(const map& arguments) + void Object::Deserialize(const map& arguments) { objectID = Utils::Utils::GetIntegerMapEntry(arguments, "objectID", ObjectNone); name = Utils::Utils::UrlDecode(Utils::Utils::GetStringMapEntry(arguments, "name")); - return true; } } // namespace DataModel Index: railcontrol/DataModel/Object.h =================================================================== --- railcontrol.orig/DataModel/Object.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Object.h 2025-11-24 15:27:11.431438980 +0100 @@ -55,7 +55,7 @@ virtual std::string Serialize() const override; - virtual bool Deserialize(const std::string& serialized) override; + virtual void Deserialize(const std::string& serialized) override; inline ObjectID GetID() const { @@ -78,7 +78,7 @@ } protected: - virtual bool Deserialize(const std::map& arguments); + virtual void Deserialize(const std::map& arguments); private: ObjectID objectID; Index: railcontrol/DataModel/ObjectIdentifier.cpp =================================================================== --- railcontrol.orig/DataModel/ObjectIdentifier.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/ObjectIdentifier.cpp 2025-11-24 15:27:11.431512923 +0100 @@ -24,80 +24,79 @@ namespace DataModel { - bool ObjectIdentifier::Deserialize(const std::map& arguments) + void ObjectIdentifier::Deserialize(const std::map& arguments) { objectID = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "track", ObjectNone)); if (objectID != ObjectNone) { objectType = ObjectTypeTrack; - return true; + return; } objectID = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "signal", ObjectNone)); if (objectID != ObjectNone) { objectType = ObjectTypeSignal; - return true; + return; } objectID = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "switch", ObjectNone)); if (objectID != ObjectNone) { objectType = ObjectTypeSwitch; - return true; + return; } objectID = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "accessory", ObjectNone)); if (objectID != ObjectNone) { objectType = ObjectTypeAccessory; - return true; + return; } objectID = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "feedback", ObjectNone)); if (objectID != ObjectNone) { objectType = ObjectTypeFeedback; - return true; + return; } objectID = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "route", ObjectNone)); if (objectID != ObjectNone) { objectType = ObjectTypeRoute; - return true; + return; } objectID = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "text", ObjectNone)); if (objectID != ObjectNone) { objectType = ObjectTypeText; - return true; + return; } objectID = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "pause", ObjectNone)); if (objectID != ObjectNone) { objectType = ObjectTypePause; - return true; + return; } objectID = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "multipleunit", ObjectNone)); if (objectID != ObjectNone) { objectType = ObjectTypeMultipleUnit; - return true; + return; } objectID = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "booster", ObjectNone)); if (objectID != ObjectNone) { objectType = ObjectTypeBooster; - return true; + return; } objectType = ObjectTypeNone; - return false; } ObjectIdentifier& ObjectIdentifier::operator=(const std::string& text) Index: railcontrol/DataModel/ObjectIdentifier.h =================================================================== --- railcontrol.orig/DataModel/ObjectIdentifier.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/ObjectIdentifier.h 2025-11-24 15:27:11.431577054 +0100 @@ -59,7 +59,7 @@ return GetObjectTypeAsString() + "=" + GetObjectIdAsString(); } - bool Deserialize(const std::map& arguments); + void Deserialize(const std::map& arguments); inline ObjectIdentifier& operator=(const ObjectIdentifier& other) = default; Index: railcontrol/DataModel/Relation.cpp =================================================================== --- railcontrol.orig/DataModel/Relation.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Relation.cpp 2025-11-24 15:27:11.431644476 +0100 @@ -46,7 +46,7 @@ return ss.str(); } - bool Relation::Deserialize(const std::string& serialized) + void Relation::Deserialize(const std::string& serialized) { map arguments; ParseArguments(serialized, arguments); @@ -58,7 +58,6 @@ object2.SetObjectID(static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "objectID2"))); priority = Utils::Utils::GetIntegerMapEntry(arguments, "priority"); data = Utils::Utils::GetIntegerMapEntry(arguments, "data"); - return true; } bool Relation::Execute(Logger::Logger* logger, const ObjectIdentifier& locoBaseIdentifier, const Delay delay) @@ -68,7 +67,7 @@ case ObjectTypeAccessory: { bool ret = manager->AccessoryState(ControlTypeInternal, ObjectID2(), static_cast(data), true); - if (ret == false) + if (!ret) { return false; } @@ -78,7 +77,7 @@ case ObjectTypeSwitch: { bool ret = manager->SwitchState(ControlTypeInternal, ObjectID2(), static_cast(data), true); - if (ret == false) + if (!ret) { return false; } @@ -88,7 +87,7 @@ case ObjectTypeSignal: { bool ret = manager->SignalState(ControlTypeInternal, ObjectID2(), static_cast(data), true); - if (ret == false) + if (!ret) { return false; } @@ -164,7 +163,7 @@ bool Relation::Reserve(Logger::Logger* logger, const ObjectIdentifier& locoBaseIdentifier) { bool ret = LockableItem::Reserve(logger, locoBaseIdentifier); - if (ret == false) + if (!ret) { logger->Debug(Languages::TextUnableToReserve); return false; @@ -180,7 +179,7 @@ } LockableItem* lockable = GetObject2(); - if (lockable == nullptr) + if (!lockable) { logger->Debug(Languages::TextRelationTargetNotFound); LockableItem::Release(logger, locoBaseIdentifier); @@ -188,7 +187,7 @@ } Route* route = dynamic_cast(lockable); - if (route != nullptr) + if (route) { return route->Reserve(logger, locoBaseIdentifier); } @@ -199,7 +198,7 @@ bool Relation::Lock(Logger::Logger* logger, const ObjectIdentifier& locoBaseIdentifier) { bool ret = LockableItem::Lock(logger, locoBaseIdentifier); - if (ret == false) + if (!ret) { return false; } @@ -214,26 +213,26 @@ } LockableItem* lockable = GetObject2(); - if (lockable == nullptr) + if (!lockable) { LockableItem::Release(logger, locoBaseIdentifier); return false; } Route* route = dynamic_cast(lockable); - if (route != nullptr) + if (route) { return route->Lock(logger, locoBaseIdentifier); } bool retLockable = lockable->Lock(logger, locoBaseIdentifier); - if (retLockable == true) + if (retLockable) { return true; } Object* object = dynamic_cast(lockable); - if (object == nullptr) + if (!object) { return false; } @@ -245,7 +244,7 @@ bool Relation::Release(Logger::Logger* logger, const ObjectIdentifier& locoBaseIdentifier) { LockableItem* object = GetObject2(); - if (object != nullptr) + if (object) { object->Release(logger, locoBaseIdentifier); } Index: railcontrol/DataModel/Relation.h =================================================================== --- railcontrol.orig/DataModel/Relation.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Relation.h 2025-11-24 15:27:11.431722430 +0100 @@ -82,7 +82,7 @@ } virtual std::string Serialize() const override; - virtual bool Deserialize(const std::string& serialized) override; + virtual void Deserialize(const std::string& serialized) override; inline ObjectID ObjectID1() const { Index: railcontrol/DataModel/Route.cpp =================================================================== --- railcontrol.orig/DataModel/Route.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Route.cpp 2025-11-24 15:27:11.431787992 +0100 @@ -84,17 +84,18 @@ return str; } - bool Route::Deserialize(const std::string& serialized) + void Route::Deserialize(const std::string& serialized) { map arguments; ParseArguments(serialized, arguments); string objectType = Utils::Utils::GetStringMapEntry(arguments, "objectType"); if (objectType.compare("Route") != 0) { - return false; + return; } LayoutItem::Deserialize(arguments); + SetRotation(LayoutItem::Rotation0); LockableItem::Deserialize(arguments); delay = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "delay", DefaultDelay)); @@ -122,7 +123,7 @@ maxTrainLength = 0; waitAfterRelease = 0; followUpRoute = RouteNone; - return true; + return; } fromTrack = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "fromTrack", TrackNone)); fromOrientation = static_cast(Utils::Utils::GetBoolMapEntry(arguments, "fromorientation", OrientationRight)); @@ -143,7 +144,6 @@ maxTrainLength = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "maxtrainlength", 0)); waitAfterRelease = Utils::Utils::GetIntegerMapEntry(arguments, "waitafterrelease", 0); followUpRoute = Utils::Utils::GetIntegerMapEntry(arguments, "followuproute", RouteNone); - return true; } void Route::DeleteRelations(std::vector& relations) Index: railcontrol/DataModel/Route.h =================================================================== --- railcontrol.orig/DataModel/Route.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Route.h 2025-11-24 15:27:11.431862272 +0100 @@ -87,6 +87,7 @@ lastUsed(0), counter(0) { + SetRotation(LayoutItem::Rotation0); } Route(Manager* manager, const std::string& serialized); @@ -103,7 +104,7 @@ } std::string Serialize() const override; - bool Deserialize(const std::string& serialized) override; + void Deserialize(const std::string& serialized) override; inline std::string GetLayoutType() const override { Index: railcontrol/DataModel/Serializable.h =================================================================== --- railcontrol.orig/DataModel/Serializable.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Serializable.h 2025-11-24 15:27:11.431926442 +0100 @@ -23,17 +23,16 @@ #include #include -namespace DataModel { - - class Serializable { +namespace DataModel +{ + class Serializable + { public: virtual ~Serializable() {}; virtual std::string Serialize() const = 0; - virtual bool Deserialize(const std::string& serialized) = 0; + virtual void Deserialize(const std::string& serialized) = 0; protected: static void ParseArguments(const std::string& serialized, std::map& arguments); }; - } // namespace DataModel - Index: railcontrol/DataModel/Signal.cpp =================================================================== --- railcontrol.orig/DataModel/Signal.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Signal.cpp 2025-11-24 15:27:11.432003346 +0100 @@ -29,22 +29,6 @@ namespace DataModel { - void Signal::SetAccessoryType(AccessoryType type) - { - AccessoryBase::SetAccessoryType(type); - ResetStateAddressMap(); - } - - ObjectType Signal::GetObjectType() const - { - return ObjectTypeSignal; - } - - std::string Signal::GetLayoutType() const - { - return Languages::GetText(Languages::TextSignal); - } - std::string Signal::Serialize() const { string str = "objectType=Signal;"; @@ -63,14 +47,14 @@ return str; } - bool Signal::Deserialize(const std::string& serialized) + void Signal::Deserialize(const std::string& serialized) { map arguments; ParseArguments(serialized, arguments); string objectType = Utils::Utils::GetStringMapEntry(arguments, "objectType"); if (objectType.compare("Signal") != 0) { - return false; + return; } AccessoryBase::Deserialize(arguments); @@ -87,7 +71,6 @@ } SetStateAddressOffset(static_cast(i), address); } - return true; } Signal& Signal::operator=(const Hardware::AccessoryCacheEntry& accessory) Index: railcontrol/DataModel/Signal.h =================================================================== --- railcontrol.orig/DataModel/Signal.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Signal.h 2025-11-24 15:27:11.432081922 +0100 @@ -78,16 +78,26 @@ Deserialize(serialized); } - virtual void SetAccessoryType(AccessoryType type) override; + inline void SetAccessoryType(AccessoryType type) override + { + AccessoryBase::SetAccessoryType(type); + ResetStateAddressMap(); + } - virtual ObjectType GetObjectType() const override; + inline ObjectType GetObjectType() const override + { + return ObjectTypeSignal; + } - virtual std::string GetLayoutType() const override; + inline std::string GetLayoutType() const override + { + return Languages::GetText(Languages::TextSignal); + } std::string Serialize() const override; using HardwareHandle::Deserialize; - virtual bool Deserialize(const std::string& serialized) override; + void Deserialize(const std::string& serialized) override; inline Track* GetTrack() const { Index: railcontrol/DataModel/Switch.cpp =================================================================== --- railcontrol.orig/DataModel/Switch.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Switch.cpp 2025-11-24 15:27:11.432140982 +0100 @@ -40,14 +40,14 @@ return str; } - bool Switch::Deserialize(const std::string& serialized) + void Switch::Deserialize(const std::string& serialized) { map arguments; ParseArguments(serialized, arguments); string objectType = Utils::Utils::GetStringMapEntry(arguments, "objectType"); if (objectType.compare("Switch") != 0) { - return false; + return; } AccessoryBase::Deserialize(arguments); @@ -55,7 +55,6 @@ LockableItem::Deserialize(arguments); SetSizeFromType(); SetVisible(VisibleYes); - return true; } void Switch::SetAccessoryState(const AccessoryState state) Index: railcontrol/DataModel/Switch.h =================================================================== --- railcontrol.orig/DataModel/Switch.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Switch.h 2025-11-24 15:27:11.432196584 +0100 @@ -68,11 +68,11 @@ std::string Serialize() const override; using HardwareHandle::Deserialize; - bool Deserialize(const std::string& serialized) override; + void Deserialize(const std::string& serialized) override; void SetAccessoryState(const AccessoryState state); - virtual inline void SetAccessoryType(AccessoryType type) override + inline void SetAccessoryType(AccessoryType type) override { AccessoryBase::SetAccessoryType(type); SetSizeFromType(); Index: railcontrol/DataModel/Text.cpp =================================================================== --- railcontrol.orig/DataModel/Text.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Text.cpp 2025-11-24 15:27:11.432250140 +0100 @@ -37,18 +37,17 @@ return str; } - bool Text::Deserialize(const string& serialized) + void Text::Deserialize(const string& serialized) { map arguments; ParseArguments(serialized, arguments); string objectType = Utils::Utils::GetStringMapEntry(arguments, "objectType"); if (objectType.compare("Text") != 0) { - return false; + return; } LayoutItem::Deserialize(arguments); SetHeight(Height1); SetVisible(VisibleYes); - return true; } } // namespace DataModel Index: railcontrol/DataModel/Text.h =================================================================== --- railcontrol.orig/DataModel/Text.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Text.h 2025-11-24 15:27:11.432303697 +0100 @@ -62,7 +62,7 @@ } std::string Serialize() const override; - bool Deserialize(const std::string& serialized) override; + void Deserialize(const std::string& serialized) override; inline std::string GetLayoutType() const override { Index: railcontrol/DataModel/Track.cpp =================================================================== --- railcontrol.orig/DataModel/Track.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Track.cpp 2025-11-24 15:27:11.432374586 +0100 @@ -41,7 +41,10 @@ std::string Track::Serialize() const { std::string str; - str = "objectType=Track"; + str = "objectType=Track;"; + str += LayoutItem::Serialize(); + str += ";"; + str += LockableItem::Serialize(); str += ";selectrouteapproach="; str += to_string(selectRouteApproach); str += ";trackstate="; @@ -64,10 +67,6 @@ str += to_string(showName); str += ";displayname="; str += displayName; - str += ";"; - str += LayoutItem::Serialize(); - str += ";"; - str += LockableItem::Serialize(); str += ";tracktype="; str += to_string(trackType); str += ";main="; @@ -75,14 +74,14 @@ return str; } - bool Track::Deserialize(const std::string& serialized) + void Track::Deserialize(const std::string& serialized) { map arguments; ParseArguments(serialized, arguments); string objectType = Utils::Utils::GetStringMapEntry(arguments, "objectType"); if (objectType.compare("Track") != 0) { - return false; + return; } LayoutItem::Deserialize(arguments); LockableItem::Deserialize(arguments); @@ -139,7 +138,6 @@ } mainID = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "master", TrackNone)); // FIXME: 2025-02-28 can be removed later mainID = static_cast(Utils::Utils::GetIntegerMapEntry(arguments, "main", mainID)); - return true; } void Track::DeleteFeedbacks() Index: railcontrol/DataModel/Track.h =================================================================== --- railcontrol.orig/DataModel/Track.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/DataModel/Track.h 2025-11-24 15:27:11.432449470 +0100 @@ -108,7 +108,7 @@ std::string Serialize() const override; - bool Deserialize(const std::string& serialized) override; + void Deserialize(const std::string& serialized) override; inline std::string GetLayoutType() const override { Index: railcontrol/Manager.cpp =================================================================== --- railcontrol.orig/Manager.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/Manager.cpp 2025-11-24 15:27:11.432656143 +0100 @@ -2679,6 +2679,7 @@ route->SetPosX(posX); route->SetPosY(posY); route->SetPosZ(posZ); + route->SetRotation(DataModel::LayoutItem::Rotation0); route->SetAutomode(automode); if (automode == AutomodeYes) { Index: railcontrol/Server/Web/HtmlTagRoute.cpp =================================================================== --- railcontrol.orig/Server/Web/HtmlTagRoute.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/Server/Web/HtmlTagRoute.cpp 2025-11-24 15:27:11.432883931 +0100 @@ -31,7 +31,9 @@ HtmlTagRoute::HtmlTagRoute(const DataModel::Route* route) : HtmlTagLayoutItem(dynamic_cast(route)) { - image += ""; + image = "" + "" + ""; string routeIdString = to_string(route->GetID()); imageDiv.AddClass("route_item"); Index: railcontrol/Server/Web/HtmlTagTrack.cpp =================================================================== --- railcontrol.orig/Server/Web/HtmlTagTrack.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/Server/Web/HtmlTagTrack.cpp 2025-11-24 15:27:11.432946828 +0100 @@ -139,9 +139,9 @@ const string& orientationSign = track->GetMainLocoOrientation() == OrientationRight ? "→ " : "← "; const string& locoName = reserved ? orientationSign + manager.GetLocoBaseName(locoBaseIdentifier) : ""; const string textPositionX = to_string(EdgeLength * trackHeight - 1); - image += "" + locoName + ""; + image += "" + locoName + ""; const string& displayName = track->GetMainDisplayName(); - image += "" + (displayName.size() ? displayName : trackName) + ""; + image += "" + (displayName.size() ? displayName : trackName) + ""; } break; } Index: railcontrol/Server/Web/WebClientRoute.cpp =================================================================== --- railcontrol.orig/Server/Web/WebClientRoute.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/Server/Web/WebClientRoute.cpp 2025-11-24 15:27:11.433036915 +0100 @@ -74,7 +74,7 @@ void WebClientRoute::HandleRouteEdit(const map& arguments) { HtmlTag content; - RouteID routeID = Utils::Utils::GetIntegerMapEntry(arguments, "route", RouteNone); + const RouteID routeID = Utils::Utils::GetIntegerMapEntry(arguments, "route", RouteNone); string name = Languages::GetText(Languages::TextNew); Delay delay = Route::DefaultDelay; Route::PushpullType pushpull = Route::PushpullTypeBoth; @@ -727,9 +727,9 @@ { std::map routes = manager.RouteListByName(); map routeOptions; - for (auto& track : routes) + for (auto& route : routes) { - routeOptions[track.first] = track.second->GetID(); + routeOptions[route.first] = route.second->GetID(); } content.AddChildTag(HtmlTagSelect(name + "_id", routeOptions, objectId).AddClass("select_relation_id")); return content; Index: railcontrol/Server/Web/WebClientText.cpp =================================================================== --- railcontrol.orig/Server/Web/WebClientText.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/Server/Web/WebClientText.cpp 2025-11-24 15:27:11.433153379 +0100 @@ -61,7 +61,7 @@ if (textID > TextNone) { const DataModel::Text* text = manager.GetText(textID); - if (text != nullptr) + if (text) { name = text->GetName(); posx = text->GetPosX(); @@ -158,7 +158,7 @@ } const DataModel::Text* text = manager.GetText(textID); - if (text == nullptr) + if (!text) { client.ReplyHtmlWithHeaderAndParagraph(Languages::TextTextDoesNotExist); return; @@ -181,7 +181,7 @@ { TextID textID = Utils::Utils::GetIntegerMapEntry(arguments, "text", TextNone); const DataModel::Text* text = manager.GetText(textID); - if (text == nullptr) + if (!text) { client.ReplyResponse(WebClient::ResponseError, Languages::TextTextDoesNotExist); return; @@ -202,7 +202,7 @@ { TextID textID = Utils::Utils::GetIntegerMapEntry(arguments, "text"); const DataModel::Text* text = manager.GetText(textID); - if (text == nullptr) + if (!text) { client.ReplyHtmlWithHeader(HtmlTag()); return; Index: railcontrol/Server/Web/WebClientText.h =================================================================== --- railcontrol.orig/Server/Web/WebClientText.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/Server/Web/WebClientText.h 2025-11-24 15:27:11.433230445 +0100 @@ -23,7 +23,6 @@ #include #include -#include "Logger/Logger.h" #include "Manager.h" namespace Server { namespace Web Index: railcontrol/Server/Web/WebClientTrack.h =================================================================== --- railcontrol.orig/Server/Web/WebClientTrack.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/Server/Web/WebClientTrack.h 2025-11-24 15:27:11.433282059 +0100 @@ -75,6 +75,4 @@ WebClient& client; Logger::Logger* logger; }; - }} // namespace Server::Web - Index: railcontrol/Server/Web/WebServer.h =================================================================== --- railcontrol.orig/Server/Web/WebServer.h 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/Server/Web/WebServer.h 2025-11-24 15:27:11.433380545 +0100 @@ -121,8 +121,8 @@ void SignalState(const ControlType controlType, const DataModel::Signal* signal) override; void ClusterDelete(const ClusterID clusterID, const std::string& name) override; void ClusterSettings(const ClusterID clusterID, const std::string& name) override; - void TextDelete(const ClusterID clusterID, const std::string& name) override; - void TextSettings(const ClusterID clusterID, const std::string& name) override; + void TextDelete(const TextID textID, const std::string& name) override; + void TextSettings(const TextID textID, const std::string& name) override; void ProgramValue(const CvNumber cv, const CvValue value) override; inline bool UpdateAvailable() Index: railcontrol/Storage/StorageHandler.cpp =================================================================== --- railcontrol.orig/Storage/StorageHandler.cpp 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/Storage/StorageHandler.cpp 2025-11-24 15:27:11.433489117 +0100 @@ -51,6 +51,10 @@ for (auto& serializedObject : serializedObjects) { Loco* loco = new Loco(manager, serializedObject); + if (!loco) + { + continue; + } locos[loco->GetID()] = loco; } } @@ -69,6 +73,10 @@ for (auto& serializedObject : serializedObjects) { MultipleUnit* multipleUnit = new MultipleUnit(manager, serializedObject); + if (!multipleUnit) + { + continue; + } const MultipleUnitID multipleUnitID = multipleUnit->GetID(); multipleUnit->AssignSlaves(RelationsFrom(DataModel::Relation::RelationTypeMultipleUnitLoco, multipleUnitID)); multipleUnits[multipleUnitID] = multipleUnit; @@ -89,7 +97,7 @@ for (auto& serializedObject : serializedObjects) { Accessory* accessory = new Accessory(serializedObject); - if (accessory == nullptr) + if (!accessory) { continue; } @@ -104,7 +112,7 @@ for (auto& serializedObject : serializedObjects) { Feedback* feedback = new Feedback(manager, serializedObject); - if (feedback == nullptr) + if (!feedback) { continue; } @@ -119,7 +127,7 @@ for (auto& serializedObject : serializedObjects) { Track* track = new Track(manager, serializedObject); - if (track == nullptr) + if (!track) { continue; } @@ -151,7 +159,7 @@ for (auto& serializedObject : serializedObjects) { Switch* mySwitch = new Switch(serializedObject); - if (mySwitch == nullptr) + if (!mySwitch) { continue; } @@ -214,7 +222,7 @@ for (auto& serializedObject : serializedObjects) { Route* route = new Route(manager, serializedObject); - if (route == nullptr) + if (!route) { continue; } @@ -239,7 +247,7 @@ for (auto& serializedObject : serializedObjects) { Layer* layer = new Layer(serializedObject); - if (layer == nullptr) + if (!layer) { continue; } @@ -254,7 +262,7 @@ for (auto& serializedObject : serializedObjects) { Signal* signal = new Signal(manager, serializedObject); - if (signal == nullptr) + if (!signal) { continue; } @@ -275,7 +283,7 @@ for (auto& serializedObject : serializedObjects) { Cluster* cluster = new Cluster(serializedObject); - if (cluster == nullptr) + if (!cluster) { continue; } @@ -292,7 +300,7 @@ for (auto& serializedObject : serializedObjects) { Text* text = new Text(serializedObject); - if (text == nullptr) + if (!text) { continue; } @@ -317,7 +325,7 @@ for (auto& relationString : relationStrings) { Relation* relation = new Relation(manager, relationString); - if (relation == nullptr) + if (!relation) { continue; } Index: railcontrol/html/style.css =================================================================== --- railcontrol.orig/html/style.css 2025-11-24 15:27:11.438141379 +0100 +++ railcontrol/html/style.css 2025-11-24 15:27:11.433601693 +0100 @@ -82,7 +82,7 @@ } } -@media (min-width: 650px) and (max-width: 999px) { +@media (min-width: 616px) and (max-width: 1023px) { .menu_config { display: none; } @@ -103,7 +103,7 @@ } } -@media (min-width: 1000px) { +@media (min-width: 1024px) { .menu_add, .menu_config, .menu_config_visible { @@ -438,8 +438,10 @@ } .text_item, +.loconame, .trackname { fill: white; + font-size: 14px; } .popup {