mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
130946fcf4
commit
6d78e63d19
2 changed files with 2 additions and 5 deletions
|
@ -8,7 +8,6 @@
|
||||||
TankItem::TankItem(QObject *parent) :
|
TankItem::TankItem(QObject *parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
QGraphicsRectItem(),
|
QGraphicsRectItem(),
|
||||||
dataModel(0),
|
|
||||||
pInfoEntry(0),
|
pInfoEntry(0),
|
||||||
pInfoNr(0)
|
pInfoNr(0)
|
||||||
{
|
{
|
||||||
|
@ -43,8 +42,7 @@ void TankItem::setData(DivePlotDataModel *model, struct plot_info *plotInfo, str
|
||||||
pInfoEntry = (struct plot_data *)malloc(size);
|
pInfoEntry = (struct plot_data *)malloc(size);
|
||||||
pInfoNr = plotInfo->nr;
|
pInfoNr = plotInfo->nr;
|
||||||
memcpy(pInfoEntry, plotInfo->entry, size);
|
memcpy(pInfoEntry, plotInfo->entry, size);
|
||||||
dataModel = model;
|
connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(modelDataChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection);
|
||||||
connect(dataModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(modelDataChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection);
|
|
||||||
modelDataChanged();
|
modelDataChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +74,7 @@ void TankItem::createBar(qreal x, qreal w, struct gasmix gas)
|
||||||
void TankItem::modelDataChanged(const QModelIndex&, const QModelIndex&)
|
void TankItem::modelDataChanged(const QModelIndex&, const QModelIndex&)
|
||||||
{
|
{
|
||||||
// We don't have enougth data to calculate things, quit.
|
// We don't have enougth data to calculate things, quit.
|
||||||
if (!dataModel || !pInfoEntry || !pInfoNr)
|
if (!pInfoEntry || !pInfoNr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// remove the old rectangles
|
// remove the old rectangles
|
||||||
|
|
|
@ -25,7 +25,6 @@ public slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createBar(qreal x, qreal w, struct gasmix gas);
|
void createBar(qreal x, qreal w, struct gasmix gas);
|
||||||
DivePlotDataModel *dataModel;
|
|
||||||
DiveCartesianAxis *hAxis;
|
DiveCartesianAxis *hAxis;
|
||||||
struct plot_data *pInfoEntry;
|
struct plot_data *pInfoEntry;
|
||||||
int pInfoNr;
|
int pInfoNr;
|
||||||
|
|
Loading…
Add table
Reference in a new issue