From abf9650280819a5e1f5b15f6d21fa297f986f42e Mon Sep 17 00:00:00 2001
From: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Date: Sat, 11 Apr 2020 18:50:53 +0200
Subject: [PATCH] cleanup: don't keep pointer-to-picture in PictureEntry

The DivePictureModel kept a pointer to picture for each entry.
Firstly, this is dangerous from a data-consistency point of view.
Secondly, the entry wasn't even used anywhere. Remove it.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
---
 qt-models/divepicturemodel.cpp | 2 +-
 qt-models/divepicturemodel.h   | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/qt-models/divepicturemodel.cpp b/qt-models/divepicturemodel.cpp
index ab54c2dc1..705f23592 100644
--- a/qt-models/divepicturemodel.cpp
+++ b/qt-models/divepicturemodel.cpp
@@ -59,7 +59,7 @@ void DivePictureModel::updateDivePictures()
 		if (dive->selected) {
 			int first = pictures.count();
 			FOR_EACH_PICTURE(dive)
-				pictures.push_back({ dive->id, picture, picture->filename, {}, picture->offset.seconds, {.seconds = 0}});
+				pictures.push_back({ dive->id, picture->filename, {}, picture->offset.seconds, {.seconds = 0}});
 
 			// Sort pictures of this dive by offset.
 			// Thus, the list will be sorted by (diveId, offset).
diff --git a/qt-models/divepicturemodel.h b/qt-models/divepicturemodel.h
index 4e25db687..5bee26864 100644
--- a/qt-models/divepicturemodel.h
+++ b/qt-models/divepicturemodel.h
@@ -10,7 +10,6 @@
 
 struct PictureEntry {
 	int diveId;
-	struct picture *picture;
 	QString filename;
 	QImage image;
 	int offsetSeconds;