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) void ProfileGraphicsView::plot(struct dive *d)
{ {
scene()->clear();
scene()->clear();
if (dive != d){ if (dive != d){
resetTransform(); resetTransform();
zoomLevel = 0; zoomLevel = 0;
dive = d; dive = d;
} }
if(!isVisible()){
return;
}
if(!dive) if(!dive)
return; return;

View file

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