diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-12-09 21:15:52 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-12-09 21:16:34 -0700 |
commit | 4029c87ec765dc49ccf2ed97dec1210d70da8014 (patch) | |
tree | f1e35ea3be844ab92c1055cd4ed291769a95542a /qt-ui | |
parent | b575069638e21f45d295faaa248e4b057ea89cc0 (diff) | |
download | subsurface-4029c87ec765dc49ccf2ed97dec1210d70da8014.tar.gz |
Hide any pictures shown when closing divelog
Fixes #776
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-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(); } |