summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveprofileitem.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-03 14:34:24 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-03 14:43:32 -0700
commitd8c31135848d765a3d241d295e5d6afc311f7820 (patch)
treea45fcebd0119f43576cc41ae1936c127bd01a88c /qt-ui/profile/diveprofileitem.cpp
parent117b212cddda614a1c668882f8165c3a6a4f3093 (diff)
downloadsubsurface-d8c31135848d765a3d241d295e5d6afc311f7820.tar.gz
UI restructure: don't use random dives from the divelist for data
Everything should come from the displayed_dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r--qt-ui/profile/diveprofileitem.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index c63f9ecc4..fda31cb12 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -450,7 +450,6 @@ void DiveGasPressureItem::modelDataChanged(const QModelIndex &topLeft, const QMo
int last_pressure[MAX_CYLINDERS] = { 0, };
int last_time[MAX_CYLINDERS] = { 0, };
struct plot_data *entry;
- struct dive *dive = get_dive_by_uniq_id(dataModel->id());
cyl = -1;
for (int i = 0, count = dataModel->rowCount(); i < count; i++) {
@@ -464,7 +463,7 @@ void DiveGasPressureItem::modelDataChanged(const QModelIndex &topLeft, const QMo
if (!seen_cyl[cyl]) {
plotPressureValue(mbar, entry->sec, Qt::AlignRight | Qt::AlignTop);
plotGasValue(mbar, entry->sec, Qt::AlignRight | Qt::AlignBottom,
- dive->cylinder[cyl].gasmix);
+ displayed_dive.cylinder[cyl].gasmix);
seen_cyl[cyl] = true;
}
}
@@ -509,11 +508,10 @@ void DiveGasPressureItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
QPen pen;
pen.setCosmetic(true);
pen.setWidth(2);
- struct dive *d = get_dive_by_uniq_id(dataModel->id());
struct plot_data *entry = dataModel->data().entry;
Q_FOREACH (const QPolygonF &poly, polygons) {
for (int i = 1, count = poly.count(); i < count; i++, entry++) {
- pen.setBrush(getSacColor(entry->sac, d->sac));
+ pen.setBrush(getSacColor(entry->sac, displayed_dive.sac));
painter->setPen(pen);
painter->drawLine(poly[i - 1], poly[i]);
}