Fix merge problem in EditSensors

Need to save the current dc as a member variable so we can apply redo
and undo to the correct dc later.

Signed-off-by: Michael Andreen <michael@andreen.dev>
This commit is contained in:
Michael Andreen 2022-03-14 16:57:13 +01:00 committed by Dirk Hohndel
parent 6354f97321
commit 451be04400
2 changed files with 2 additions and 3 deletions

View file

@ -1362,9 +1362,8 @@ void EditCylinder::undo()
}
EditSensors::EditSensors(int toCylinderIn, int fromCylinderIn)
: d(current_dive), toCylinder(toCylinderIn), fromCylinder(fromCylinderIn)
: d(current_dive), dc(get_dive_dc(d, dc_number)), toCylinder(toCylinderIn), fromCylinder(fromCylinderIn)
{
const struct divecomputer *dc = get_dive_dc(d, dc_number);
if (!d || !dc)
return;

View file

@ -446,8 +446,8 @@ public:
EditSensors(int cylIndex, int fromCylinder);
private:
struct divecomputer *dc;
struct dive *d;
struct divecomputer *dc;
int toCylinder;
int fromCylinder;
void mapSensors(int toCyl, int fromCyl);