Enable removal of pictures from different dives at the same moment

Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2017-12-11 21:40:06 +01:00 committed by Dirk Hohndel
parent 7bc77947f6
commit 82170579ad
3 changed files with 12 additions and 4 deletions

View file

@ -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();