summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-03-07 12:08:31 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-07 08:53:14 -0800
commit6dec4b055601526a0c8bf9e45dfe0ff648d80489 (patch)
treeb7c2207f2e6b0e218beb9e8e53fad779adb97498 /qt-ui/profile/profilewidget2.cpp
parent80341062195b27ea2f6d16ef22225b439ac84165 (diff)
downloadsubsurface-6dec4b055601526a0c8bf9e45dfe0ff648d80489.tar.gz
Fix a crash on changing dives when the ruler is used.
The ruler is a weird beast - it has two child objects that access the parent to call another function, that call the child functions. When I updated the plot_info I didn't take that into consideration, what happened is that when I set the parent's plot_info, the children's plot_info are still invalid, but the update method is called anyhow. This patch updates all plot_info's before calling anything else. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r--qt-ui/profile/profilewidget2.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 1cbc6c1a5..67d857ce2 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -365,7 +365,6 @@ void ProfileWidget2::plotDives(QList<dive *> dives)
heartBeatAxis->setVisible(false);
}
timeAxis->setMaximum(maxtime);
- rulerItem->setPlotInfo(pInfo);
int i, incr;
static int increments[8] = { 10, 20, 30, 60, 5 * 60, 10 * 60, 15 * 60, 30 * 60 };
/* Time markers: at most every 10 seconds, but no more than 12 markers.
@@ -385,6 +384,8 @@ void ProfileWidget2::plotDives(QList<dive *> dives)
timeAxis->updateTicks();
cylinderPressureAxis->setMinimum(pInfo.minpressure);
cylinderPressureAxis->setMaximum(pInfo.maxpressure);
+
+ rulerItem->setPlotInfo(pInfo);
meanDepth->setMeanDepth(pInfo.meandepth);
meanDepth->setLine(0, 0, timeAxis->posAtValue(d->duration.seconds), 0);
meanDepth->animateMoveTo(3, profileYAxis->posAtValue(pInfo.meandepth));