From 4ae87da58cda895f3573704966ef2e0dd8161864 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 6 Mar 2020 23:20:58 +0100 Subject: undo: reload dive on removal of gas-switch If a gas-switch is removed we have to perform the same action as if a gas-switch is added: fixup the dive and signal the changed cylinder and stats. Adapt the RemoveEvent command accordingly. Copy the code of the AddGasSwitch command and simplify for the fact that only ony cylinder can be affected. Signed-off-by: Berthold Stoeger --- commands/command_event.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'commands/command_event.h') diff --git a/commands/command_event.h b/commands/command_event.h index a363540d5..b7e67f218 100644 --- a/commands/command_event.h +++ b/commands/command_event.h @@ -79,9 +79,11 @@ private: bool workToBeDone() override; void undoit() override; void redoit() override; + void post() const; // Called to fix up dives should a gas-change have happened. OwningEventPtr eventToAdd; // for undo event *eventToRemove; // for redo + int cylinder; // affected cylinder (if removing gas switch). <0: not a gas switch. }; class AddGasSwitch : public EventBase { -- cgit v1.2.3-70-g09d2