Moved the temperature item as a 'Cache'

This patch moves the temperature item as a cache that will
be updated as the model updates, instead of deleting / recreating
it everytime the dive changes.

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-23 15:44:12 -02:00 committed by Dirk Hohndel
parent 555ca8245d
commit 563c39b822
2 changed files with 10 additions and 14 deletions

View file

@ -192,7 +192,7 @@ DiveTemperatureItem::DiveTemperatureItem()
void DiveTemperatureItem::modelDataChanged()
{
// We don't have enougth data to calculate things, quit.
if (!hAxis || !vAxis || !dataModel || hDataColumn == -1 || vDataColumn == -1)
if (!hAxis || !vAxis || !dataModel || hDataColumn == -1 || vDataColumn == -1 || dataModel->rowCount() == 0)
return;
qDeleteAll(texts);