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.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/qt-models/divepicturemodel.cpp b/qt-models/divepicturemodel.cpp
index 894cd3db6..994eb674e 100644
--- a/qt-models/divepicturemodel.cpp
+++ b/qt-models/divepicturemodel.cpp
@@ -119,7 +119,12 @@ QVariant DivePictureModel::data(const QModelIndex &index, int role) const
void DivePictureModel::removePicture(const QString &fileUrl, bool last)
{
- dive_remove_picture(fileUrl.toUtf8().data());
+ int i;
+ struct dive *dive;
+ for_each_dive (i, dive) {
+ if (dive->selected && dive_remove_picture(dive, fileUrl.toUtf8().data()))
+ break;
+ }
if (last) {
copy_dive(current_dive, &displayed_dive);
updateDivePictures();