Fixed loading the first dive via command line on the profile.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-05-10 14:18:33 -03:00 committed by Dirk Hohndel
parent 1fec7d849c
commit 56c4cced53
2 changed files with 12 additions and 1 deletions

View file

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

View file

@ -69,6 +69,7 @@ protected:
void resizeEvent(QResizeEvent *event);
void mouseMoveEvent(QMouseEvent* event);
void wheelEvent(QWheelEvent* event);
void showEvent(QShowEvent* event);
private:
void plot_depth_profile();