From 9962d47b56eb15aba9339b22845566535c168483 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 17 Apr 2020 22:43:43 +0200 Subject: media: turn DivePictureModel::pictures into std::vector QVector doesn't have a function to insert a range of pictures, which we will need for undo of image adding/deletion. Moreover, std::vector gives us stronger guarantees. For example, if capacity is large enough, it guarantees that there will be no reallocation and thus iterators stay valid. I have not found such a guarantee in the Qt docs. Signed-off-by: Berthold Stoeger --- qt-models/divepicturemodel.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'qt-models/divepicturemodel.h') diff --git a/qt-models/divepicturemodel.h b/qt-models/divepicturemodel.h index 523d552e3..395dbedd1 100644 --- a/qt-models/divepicturemodel.h +++ b/qt-models/divepicturemodel.h @@ -6,7 +6,6 @@ #include #include -#include // 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. @@ -36,7 +35,7 @@ public slots: void pictureOffsetChanged(dive *d, const QString filename, offset_t offset); private: DivePictureModel(); - QVector pictures; + std::vector pictures; int findPictureId(const std::string &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