From f47f2773fd4de5bfbb8d90e5e00dc18e0c18e5bb Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 19 May 2018 21:18:39 +0200 Subject: Dive pictures: don't repopulate DivePictureModel on deletion On deletion of a single or multiple pictures, the whole DivePictureModel was repopulated, which was clearly visible in the UI, owing to the reconstructing of all images in the profile plot. To avoid this vexing behavior, implement proper deletion routines in DivePictureModel and ProfileWidget2. Since this needs sensible erase() semantics the QList member of DivePictureModel was replaced by a QVector. A QVector should be the default anyway, unless there are very specific reasons to use a QList (which actually is a deque, not a classical linked list). Signed-off-by: Berthold Stoeger --- qt-models/divepicturemodel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-models/divepicturemodel.h') diff --git a/qt-models/divepicturemodel.h b/qt-models/divepicturemodel.h index 61eb1d984..a7a3d7180 100644 --- a/qt-models/divepicturemodel.h +++ b/qt-models/divepicturemodel.h @@ -30,7 +30,7 @@ public slots: void updateThumbnail(QString filename, QImage thumbnail); private: DivePictureModel(); - QList pictures; + QVector pictures; int findPictureId(const QString &filename); // Return -1 if not found double zoomLevel; // -1.0: minimum, 0.0: standard, 1.0: maximum int size; -- cgit v1.2.3-70-g09d2