From 9993d4996659b2d6c07f283895acb6409012ea9c Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 12 Jun 2013 14:28:44 -0300 Subject: Do not plot on showEvent if dive is already plotted. We do a force-plot on showEvent because the user can have asked to open a dive file via command line, so the app needs to open already with a profile plotted. if the user opens the program, loads a map, hides the profile by hitting ctrl + 1, then shows the profile again by hitting ctrl + 2, we do not want to do all the math to show the profile again, because we already have it in memory. this also fixes dirk's strange behavior of funky profile. Signed-off-by: Tomaz Canabrava --- qt-ui/profilegraphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-ui/profilegraphics.cpp') diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index 164de13ff..be2f5f039 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -212,7 +212,7 @@ void ProfileGraphicsView::showEvent(QShowEvent* event) // but the dive was not ploted. // force a replot by modifying the dive // hold by the view, and issuing a plot. - if (dive) { + if (dive && !scene()->items().count()) { dive = 0; plot(get_dive(selected_dive)); } -- cgit v1.2.3-70-g09d2