aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget/divecartesianaxis.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-12-29 22:49:40 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-10 15:57:39 -0800
commitdd0939b6f5c9c7399183f2a36b2be77521886ef0 (patch)
treed8e6fec81774da585c55432be19f414e6ad20f41 /profile-widget/divecartesianaxis.h
parentf4103e4998d0a2512b6b8db931a81911b3e908a0 (diff)
downloadsubsurface-dd0939b6f5c9c7399183f2a36b2be77521886ef0.tar.gz
profile: explicitly update gas-axis
On each profile replot, the gas axis was implicitly reset by calling "dataModel->emitDataChanged()", which would send a signal recieved by the axis. To make the code less confusing and, more importantly, make order of execution deterministic, explicitly reset the axis. Rename the function that resets the axis from "settingsChanged" to "update" to reflect its usage. Moreover, remove the "setModel()" function and pass the model to the constructore. Make it a const reference to make clear that it can't change during the life time of the axis. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/divecartesianaxis.h')
-rw-r--r--profile-widget/divecartesianaxis.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/profile-widget/divecartesianaxis.h b/profile-widget/divecartesianaxis.h
index 1ea623649..a4a38dd1e 100644
--- a/profile-widget/divecartesianaxis.h
+++ b/profile-widget/divecartesianaxis.h
@@ -109,13 +109,12 @@ private:
class PartialGasPressureAxis : public DiveCartesianAxis {
Q_OBJECT
public:
- PartialGasPressureAxis(ProfileWidget2 *widget);
- void setModel(DivePlotDataModel *model);
+ PartialGasPressureAxis(const DivePlotDataModel &model, ProfileWidget2 *widget);
public
slots:
- void settingsChanged();
+ void update();
private:
- DivePlotDataModel *model;
+ const DivePlotDataModel &model;
};
#endif // DIVECARTESIANAXIS_H