mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
aa5365eb3f
commit
7293885178
2 changed files with 3 additions and 0 deletions
1
dive.h
1
dive.h
|
@ -726,6 +726,7 @@ void get_gas_string(int o2, int he, char *buf, int len);
|
|||
struct divedatapoint *create_dp(int time_incr, int depth, int o2, int he, int po2);
|
||||
void dump_plan(struct diveplan *diveplan);
|
||||
void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, char **error_string_p);
|
||||
void delete_single_dive(int idx);
|
||||
|
||||
struct event *get_next_event(struct event *event, char *name);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "graphicsview-common.h"
|
||||
|
||||
#include "../dive.h"
|
||||
#include "../divelist.h"
|
||||
#include <cmath>
|
||||
#include <QMouseEvent>
|
||||
#include <QDebug>
|
||||
|
@ -497,6 +498,7 @@ void DivePlannerGraphics::createDecoStops()
|
|||
diveBg->setBrush(pat);
|
||||
|
||||
deleteTemporaryDivePlan(diveplan.dp);
|
||||
delete_single_dive(get_divenr(dive));
|
||||
}
|
||||
|
||||
void DivePlannerGraphics::deleteTemporaryDivePlan(divedatapoint* dp)
|
||||
|
|
Loading…
Add table
Reference in a new issue