From e140703d34325344f503fc328c20643a8ea9249a Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 30 May 2014 15:16:00 -0300 Subject: Add a method to update the dive pictures on the model. Call that method from the mainWindow when the dive changes. The updateDivePictures walks around the events of the first dc (since all pictures are distributed allong all dive computers) to get the events of type '123' (I wonder if there's not a better way to save pictures on the dive, like an linked list of char* named pictures.) Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qt-ui/mainwindow.cpp') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index dad8e4706..964d2bbc2 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -59,7 +59,8 @@ MainWindow::MainWindow() : QMainWindow(), yearlyStatsModel(0), state(VIEWALL), updateManager(0), - fakeDiveId(0) + fakeDiveId(0), + divePictureModel(new DivePictureModel(this)) { Q_ASSERT_X(m_Instance == NULL, "MainWindow", "MainWindow recreated!"); m_Instance = this; @@ -165,6 +166,7 @@ void MainWindow::current_dive_changed(int divenr) */ ui.newProfile->plotDives(QList() << (current_dive)); ui.InfoWidget->updateDiveInfo(divenr); + divePictureModel->updateDivePictures(divenr); } void MainWindow::on_actionNew_triggered() -- cgit v1.2.3-70-g09d2