aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-07-29 21:50:30 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-07-30 08:02:05 -0700
commit55bc1938adade6488c2deacf6d88b66d0780299e (patch)
treefa8a3bf21dc59be0de27404b4bbf77e9fdb8ae53
parentf16a7c262eabfbfd4c70f866d8ee11b8ebda4269 (diff)
downloadsubsurface-55bc1938adade6488c2deacf6d88b66d0780299e.tar.gz
cleanup: remove DiveCalculatedCeiling::profileWidget
The DiveCalculatedCeiling had a back-pointer to the profileWidget. This was used for weird control-flow shenanigans, which were removed in 975c123a30de95eafd9b3c2ce2a625a1d05a79dc. Remove this now useless member variable. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--profile-widget/diveprofileitem.cpp9
-rw-r--r--profile-widget/diveprofileitem.h8
-rw-r--r--profile-widget/profilewidget2.cpp4
3 files changed, 8 insertions, 13 deletions
diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp
index 621674b8f..8e626a0fe 100644
--- a/profile-widget/diveprofileitem.cpp
+++ b/profile-widget/diveprofileitem.cpp
@@ -609,9 +609,8 @@ void DiveGasPressureItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
painter->restore();
}
-DiveCalculatedCeiling::DiveCalculatedCeiling(const DivePlotDataModel &model, const DiveCartesianAxis &hAxis, int hColumn, const DiveCartesianAxis &vAxis, int vColumn, ProfileWidget2 *widget) :
- AbstractProfilePolygonItem(model, hAxis, hColumn, vAxis, vColumn),
- profileWidget(widget)
+DiveCalculatedCeiling::DiveCalculatedCeiling(const DivePlotDataModel &model, const DiveCartesianAxis &hAxis, int hColumn, const DiveCartesianAxis &vAxis, int vColumn) :
+ AbstractProfilePolygonItem(model, hAxis, hColumn, vAxis, vColumn)
{
connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::calcceilingChanged, this, &DiveCalculatedCeiling::setVisible);
setVisible(prefs.calcceiling);
@@ -645,8 +644,8 @@ void DiveCalculatedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsI
QGraphicsPolygonItem::paint(painter, option, widget);
}
-DiveCalculatedTissue::DiveCalculatedTissue(const DivePlotDataModel &model, const DiveCartesianAxis &hAxis, int hColumn, const DiveCartesianAxis &vAxis, int vColumn, ProfileWidget2 *widget) :
- DiveCalculatedCeiling(model, hAxis, hColumn, vAxis, vColumn, widget)
+DiveCalculatedTissue::DiveCalculatedTissue(const DivePlotDataModel &model, const DiveCartesianAxis &hAxis, int hColumn, const DiveCartesianAxis &vAxis, int vColumn) :
+ DiveCalculatedCeiling(model, hAxis, hColumn, vAxis, vColumn)
{
setVisible(true);
connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::calcalltissuesChanged, this, &DiveCalculatedTissue::setVisible);
diff --git a/profile-widget/diveprofileitem.h b/profile-widget/diveprofileitem.h
index 81452b66e..6e19fe92c 100644
--- a/profile-widget/diveprofileitem.h
+++ b/profile-widget/diveprofileitem.h
@@ -22,7 +22,6 @@
This is a generically item and should be used as a base for others, I think...
*/
-class ProfileWidget2;
class DivePlotDataModel;
class DiveTextItem;
class DiveCartesianAxis;
@@ -143,12 +142,9 @@ class DiveCalculatedCeiling : public AbstractProfilePolygonItem {
public:
DiveCalculatedCeiling(const DivePlotDataModel &model, const DiveCartesianAxis &hAxis, int hColumn,
- const DiveCartesianAxis &vAxis, int vColumn, ProfileWidget2 *profileWidget);
+ const DiveCartesianAxis &vAxis, int vColumn);
void replot(const dive *d, bool in_planner) override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
-
-private:
- ProfileWidget2 *profileWidget;
};
class DiveReportedCeiling : public AbstractProfilePolygonItem {
@@ -164,7 +160,7 @@ class DiveCalculatedTissue : public DiveCalculatedCeiling {
Q_OBJECT
public:
DiveCalculatedTissue(const DivePlotDataModel &model, const DiveCartesianAxis &hAxis, int hColumn,
- const DiveCartesianAxis &vAxis, int vColumn, ProfileWidget2 *profileWidget);
+ const DiveCartesianAxis &vAxis, int vColumn);
void setVisible(bool visible);
};
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 918182fe6..55a00a8e8 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -127,7 +127,7 @@ ProfileWidget2::ProfileWidget2(DivePlannerPointsModel *plannerModelIn, QWidget *
ccrsensor2GasItem(createPPGas(DivePlotDataModel::CCRSENSOR2, CCRSENSOR2, PO2_ALERT, &prefs.pp_graphs.po2_threshold_min, &prefs.pp_graphs.po2_threshold_max)),
ccrsensor3GasItem(createPPGas(DivePlotDataModel::CCRSENSOR3, CCRSENSOR3, PO2_ALERT, &prefs.pp_graphs.po2_threshold_min, &prefs.pp_graphs.po2_threshold_max)),
ocpo2GasItem(createPPGas(DivePlotDataModel::SCR_OC_PO2, SCR_OCPO2, PO2_ALERT, &prefs.pp_graphs.po2_threshold_min, &prefs.pp_graphs.po2_threshold_max)),
- diveCeiling(createItem<DiveCalculatedCeiling>(*profileYAxis, DivePlotDataModel::CEILING, 1, this)),
+ diveCeiling(createItem<DiveCalculatedCeiling>(*profileYAxis, DivePlotDataModel::CEILING, 1)),
decoModelParameters(new DiveTextItem()),
#ifndef SUBSURFACE_MOBILE
heartBeatAxis(new DiveCartesianAxis(this)),
@@ -304,7 +304,7 @@ void ProfileWidget2::setupItemOnScene()
decoModelParameters->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
#ifndef SUBSURFACE_MOBILE
for (int i = 0; i < 16; i++) {
- DiveCalculatedTissue *tissueItem = createItem<DiveCalculatedTissue>(*profileYAxis, DivePlotDataModel::TISSUE_1 + i, i + 1, this);
+ DiveCalculatedTissue *tissueItem = createItem<DiveCalculatedTissue>(*profileYAxis, DivePlotDataModel::TISSUE_1 + i, i + 1);
allTissues.append(tissueItem);
DivePercentageItem *percentageItem = createItem<DivePercentageItem>(*percentageAxis, DivePlotDataModel::PERCENTAGE_1 + i, i + 1, i);
allPercentages.append(percentageItem);