summaryrefslogtreecommitdiffstats
path: root/qt-models/divepicturemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/divepicturemodel.cpp')
-rw-r--r--qt-models/divepicturemodel.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/qt-models/divepicturemodel.cpp b/qt-models/divepicturemodel.cpp
index 1f37423e2..bb5db33b7 100644
--- a/qt-models/divepicturemodel.cpp
+++ b/qt-models/divepicturemodel.cpp
@@ -111,12 +111,14 @@ QVariant DivePictureModel::data(const QModelIndex &index, int role) const
return ret;
}
-void DivePictureModel::removePicture(const QString &fileUrl)
+void DivePictureModel::removePicture(const QString &fileUrl, bool last)
{
dive_remove_picture(fileUrl.toUtf8().data());
- copy_dive(current_dive, &displayed_dive);
- updateDivePictures();
- mark_divelist_changed(true);
+ if (last) {
+ copy_dive(current_dive, &displayed_dive);
+ updateDivePictures();
+ mark_divelist_changed(true);
+ }
}
int DivePictureModel::rowCount(const QModelIndex &parent) const