From 7293885178de700558f7954725ef9d8965cdb17a Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Fri, 5 Jul 2013 23:42:35 +0200 Subject: Delte the temporary dive from the divelist after calculating deco. This bug manifested itself as too long deco obligation when moving waypoints to later and then back to earlier times as all intermedite versions were created as dives in the divelist (and the saturation of these "previous dives" was taken into account. It is not entirely clear to me how the dive will be permanently added to the divelist once ok is pressed: One could in createDecoStops allocate struct dive from the heap rather than from the stack and return a pointer to it and which is then added to the dive list upon pressing ok. [Dirk Hohndel: add include file to make this compile] Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 25d5df11d..95b6c211c 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -2,6 +2,7 @@ #include "graphicsview-common.h" #include "../dive.h" +#include "../divelist.h" #include #include #include @@ -497,6 +498,7 @@ void DivePlannerGraphics::createDecoStops() diveBg->setBrush(pat); deleteTemporaryDivePlan(diveplan.dp); + delete_single_dive(get_divenr(dive)); } void DivePlannerGraphics::deleteTemporaryDivePlan(divedatapoint* dp) -- cgit v1.2.3-70-g09d2