From 2f35c940261fe0f5fdb2723072553c036492e608 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 16 May 2013 21:25:31 -0300 Subject: Fix loading a dive via command line. Signed-off-by: Tomaz Canabrava --- qt-ui/profilegraphics.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index 8ab4aa845..637c7fe95 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -202,8 +202,14 @@ static void plot_set_scale(scale_mode_t scale) void ProfileGraphicsView::showEvent(QShowEvent* event) { - if (dive) - plot(dive); + // Program just opened, + // but the dive was not ploted. + // force a replot by modifying the dive + // hold by the view, and issuing a plot. + if (dive){ + dive = 0; + plot(get_dive(selected_dive)); + } } void ProfileGraphicsView::clear() -- cgit v1.2.3-70-g09d2