media: store dive instead of dive-id in DivePictureModel

dive-pointers are stable and the dive picture model is reset
if a selected dive is removed, so there is no risk in keeping
pointers.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-04-14 22:14:23 +02:00 committed by Dirk Hohndel
parent 0d06eb83d8
commit bd960ea088
2 changed files with 6 additions and 6 deletions

View file

@ -10,15 +10,15 @@
// We use std::string instead of QString to use the same character-encoding
// as in the C core (UTF-8). This is crucial to guarantee the same sort-order.
struct dive;
struct PictureEntry {
int diveId;
dive *d;
std::string filename;
QImage image;
int offsetSeconds;
duration_t length;
};
struct dive;
class DivePictureModel : public QAbstractTableModel {
Q_OBJECT
public: