summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-06-12 14:28:44 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-06-12 14:28:44 -0300
commit9993d4996659b2d6c07f283895acb6409012ea9c (patch)
tree3d493add3f8fb3153d524f9c1faab2771a492b5f
parentab0213f28ecfb1b49ca0c5c7c1d6900ab1fb8d71 (diff)
downloadsubsurface-9993d4996659b2d6c07f283895acb6409012ea9c.tar.gz
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 <tcanabrava@kde.org>
-rw-r--r--qt-ui/profilegraphics.cpp2
1 files changed, 1 insertions, 1 deletions
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));
}