Remember to clean the tissues when changing dives.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-01-21 15:42:33 -02:00 committed by Dirk Hohndel
parent a73f00dcac
commit 4159faa950

View file

@ -375,6 +375,7 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
diveComputerText->animateMoveTo(1 , sceneRect().height());
qDeleteAll(allTissues);
allTissues.clear();
for(int i = 0; i < 16; i++){
DiveCalculatedCeiling *tissueItem = new DiveCalculatedCeiling();
tissueItem->setHorizontalAxis(timeAxis);
@ -382,6 +383,7 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
tissueItem->setModel(dataModel);
tissueItem->setVerticalDataColumn(DivePlotDataModel::TISSUE_1 + i);
tissueItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
allTissues.append(tissueItem);
scene()->addItem(tissueItem);
}
emit startProfileState();