diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-05-10 14:18:33 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-05-10 10:49:00 -0700 |
commit | 56c4cced536b8b1bb7282f263deb24640632e884 (patch) | |
tree | a4658b7ca23fa5255db2e459407d2d6653d9757a /qt-ui/profilegraphics.cpp | |
parent | 1fec7d849c69e7e6cca71c268e9331a4a52ad6e8 (diff) | |
download | subsurface-56c4cced536b8b1bb7282f263deb24640632e884.tar.gz |
Fixed loading the first dive via command line on the profile.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/profilegraphics.cpp')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index c01022799..c2f71be11 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -194,16 +194,26 @@ static void plot_set_scale(scale_mode_t scale) } } +void ProfileGraphicsView::showEvent(QShowEvent* event) +{ + if (dive) + plot(dive); +} + void ProfileGraphicsView::plot(struct dive *d) { - scene()->clear(); + scene()->clear(); if (dive != d){ resetTransform(); zoomLevel = 0; dive = d; } + if(!isVisible()){ + return; + } + if(!dive) return; |