From 82170579ad917c3ce328131dff24018123a34d6a Mon Sep 17 00:00:00 2001 From: Stefan Fuchs Date: Mon, 11 Dec 2017 21:40:06 +0100 Subject: Enable removal of pictures from different dives at the same moment Suggested-by: Berthold Stoeger Signed-off-by: Stefan Fuchs --- qt-models/divepicturemodel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'qt-models') 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(); -- cgit v1.2.3-70-g09d2