diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-10-27 15:22:34 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-10-27 12:42:21 -0700 |
commit | 6d78e63d19e4aed9b25a720ee8c6fdac450be289 (patch) | |
tree | 1df301f6088520204833b46786c6cbba8750664d /profile-widget | |
parent | 130946fcf45375283661547502c389390bc2d443 (diff) | |
download | subsurface-6d78e63d19e4aed9b25a720ee8c6fdac450be289.tar.gz |
Cleanup: remove TankItem::modelData member variable
This is only used for an "is initialized"-check. But there are
other member variables that are used for that purpose. Remove.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget')
-rw-r--r-- | profile-widget/tankitem.cpp | 6 | ||||
-rw-r--r-- | profile-widget/tankitem.h | 1 |
2 files changed, 2 insertions, 5 deletions
diff --git a/profile-widget/tankitem.cpp b/profile-widget/tankitem.cpp index dfb1f4906..d01b23965 100644 --- a/profile-widget/tankitem.cpp +++ b/profile-widget/tankitem.cpp @@ -8,7 +8,6 @@ TankItem::TankItem(QObject *parent) : QObject(parent), QGraphicsRectItem(), - dataModel(0), pInfoEntry(0), pInfoNr(0) { @@ -43,8 +42,7 @@ void TankItem::setData(DivePlotDataModel *model, struct plot_info *plotInfo, str pInfoEntry = (struct plot_data *)malloc(size); pInfoNr = plotInfo->nr; memcpy(pInfoEntry, plotInfo->entry, size); - dataModel = model; - connect(dataModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(modelDataChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection); + connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(modelDataChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection); modelDataChanged(); } @@ -76,7 +74,7 @@ void TankItem::createBar(qreal x, qreal w, struct gasmix gas) void TankItem::modelDataChanged(const QModelIndex&, const QModelIndex&) { // We don't have enougth data to calculate things, quit. - if (!dataModel || !pInfoEntry || !pInfoNr) + if (!pInfoEntry || !pInfoNr) return; // remove the old rectangles diff --git a/profile-widget/tankitem.h b/profile-widget/tankitem.h index cd77b6955..e7f82678e 100644 --- a/profile-widget/tankitem.h +++ b/profile-widget/tankitem.h @@ -25,7 +25,6 @@ public slots: private: void createBar(qreal x, qreal w, struct gasmix gas); - DivePlotDataModel *dataModel; DiveCartesianAxis *hAxis; struct plot_data *pInfoEntry; int pInfoNr; |