mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
properly restore local edits of charge sockets
fixes #2368 Signed-off-by: Séverin Lemaignan <severin@guakamole.org>
This commit is contained in:
committed by
map-per
parent
eaa56e5127
commit
3b0b4520a1
@@ -720,7 +720,17 @@ void EditableMapObject::ApplyJournalEntry(JournalEntry const & entry)
|
||||
MetadataID type;
|
||||
if (feature::Metadata::TypeFromString(tagModData.key, type))
|
||||
{
|
||||
m_metadata.Set(type, tagModData.new_value);
|
||||
if (type == MetadataID::FMD_CHARGE_SOCKETS)
|
||||
{
|
||||
// Charge sockets need special handling: we need to aggregate the new entry
|
||||
// to existing ones, not just replace the whole string.
|
||||
ChargeSocketsHelper helper(GetChargeSockets());
|
||||
helper.AggregateChargeSocketKey(tagModData.key, tagModData.new_value);
|
||||
m_metadata.Set(type, helper.ToString());
|
||||
}
|
||||
else
|
||||
m_metadata.Set(type, tagModData.new_value);
|
||||
|
||||
if (type == MetadataID::FMD_INTERNET)
|
||||
{
|
||||
uint32_t const wifiType = ftypes::IsWifiChecker::Instance().GetType();
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
|
||||
ChargeSocketsHelper(ChargeSocketDescriptors const & sockets) : m_chargeSockets(sockets), m_dirty(true) {}
|
||||
|
||||
/** Create a ChareSocketsHelper instance from an existing list of sockets
|
||||
/** Create a ChargeSocketsHelper instance from an existing list of sockets
|
||||
* stored as "<type>|<nb>|[<power>];..."
|
||||
*
|
||||
* For instance:
|
||||
|
||||
Reference in New Issue
Block a user