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>
This commit is contained in:
Tomaz Canabrava 2013-06-12 14:28:44 -03:00
parent ab0213f28e
commit 9993d49966

View file

@ -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));
}