mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: save depth of event
The DivePlotDataModel was saved with every event to access the depth. However, since the depth never changes, we can simply save the depth instead. Also, since we only need the model to access the plot_info, pass the plot_info directly. As noted in a previous commit message, I believe that Qt models are a very bad choice for intra-application data transfer. They should only ever be used to interface with Qt. And since touching this code, pass duration_t instead of int to depthAtTime() to make the callers less cluttered. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
9ddaf791ae
commit
9740651e01
3 changed files with 16 additions and 18 deletions
|
@ -500,8 +500,8 @@ void ProfileScene::plotDive(const struct dive *dIn, int dcIn, DivePlannerPointsM
|
|||
// printMode is always selected for SUBSURFACE_MOBILE due to font problems
|
||||
// BUT events are wanted.
|
||||
#endif
|
||||
if (DiveEventItem::isInteresting(d, currentdc, event, *dataModel)) {
|
||||
auto item = new DiveEventItem(d, event, lastgasmix, dataModel,
|
||||
if (DiveEventItem::isInteresting(d, currentdc, event, plotInfo)) {
|
||||
auto item = new DiveEventItem(d, event, lastgasmix, plotInfo,
|
||||
timeAxis, profileYAxis, animSpeed, *pixmaps);
|
||||
item->setZValue(2);
|
||||
addItem(item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue