diff options
-rw-r--r-- | qt-ui/divepicturewidget.cpp | 3 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/divepicturewidget.cpp b/qt-ui/divepicturewidget.cpp index 03c0321d4..d42afefbf 100644 --- a/qt-ui/divepicturewidget.cpp +++ b/qt-ui/divepicturewidget.cpp @@ -44,7 +44,8 @@ void DivePictureModel::updateDivePictures() endRemoveRows(); } - numberOfPictures = dive_get_picture_count(&displayed_dive); + // if the dive_table is empty, ignore the displayed_dive + numberOfPictures = dive_table.nr == 0 ? 0 : dive_get_picture_count(&displayed_dive); if (numberOfPictures == 0) { return; } diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 901a039f3..acf520dd6 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -289,6 +289,8 @@ void MainWindow::on_actionClose_triggered() { if (okToClose(tr("Please save or cancel the current dive edit before closing the file."))) { closeCurrentFile(); + // hide any pictures and the filter + DivePictureModel::instance()->updateDivePictures(); ui.multiFilter->closeFilter(); recreateDiveList(); } |