diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-02-11 14:01:53 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-11 14:08:17 -0800 |
commit | 48e9257de4b72327be0b746f32cdc92811b032b6 (patch) | |
tree | 647d8c2f8edd9aee3df850c1544400420c4c83a2 /qt-ui/profile/diveprofileitem.cpp | |
parent | e58f54cac1d050c090bfa5427991ae440bc78495 (diff) | |
download | subsurface-48e9257de4b72327be0b746f32cdc92811b032b6.tar.gz |
Fix variable scope issue
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r-- | qt-ui/profile/diveprofileitem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index f60760881..f8a37aeba 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -227,6 +227,7 @@ DiveTemperatureItem::DiveTemperatureItem() void DiveTemperatureItem::modelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) { + int last = -300, last_printed_temp = 0, sec = 0; // We don't have enougth data to calculate things, quit. if (!shouldCalculateStuff(topLeft, bottomRight)) return; @@ -235,12 +236,11 @@ void DiveTemperatureItem::modelDataChanged(const QModelIndex& topLeft, const QMo texts.clear(); // Ignore empty values. things do not look good with '0' as temperature in kelvin... QPolygonF poly; - int last = -300, last_printed_temp = 0, sec = 0; for (int i = 0, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++) { int mkelvin = dataModel->index(i, vDataColumn).data().toInt(); if (!mkelvin) continue; - int sec = dataModel->index(i, hDataColumn).data().toInt(); + sec = dataModel->index(i, hDataColumn).data().toInt(); QPointF point( hAxis->posAtValue(sec), vAxis->posAtValue(mkelvin)); poly.append(point); |