From 3c0c1801cd869f7a98c23356ab2ae4e373f55f31 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 18 May 2018 21:57:18 +0200 Subject: Dive pictures: change removePicture() interface The function removePicture() had a flag "last", which would indicate that the called had finished removing pictures. Only then would the model be recalculated. This is a strange interface and, matter of fact, the caller was buggy: if the last picture to be removed didn't have a proper url, removePicture() was never called with "last" being set. Change the interface to take a list of pictures to be deleted. This will allow us to make picture deletion smarter in follow-up commits. Signed-off-by: Berthold Stoeger --- profile-widget/divepixmapitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profile-widget') diff --git a/profile-widget/divepixmapitem.cpp b/profile-widget/divepixmapitem.cpp index c81cd51e1..27fea611b 100644 --- a/profile-widget/divepixmapitem.cpp +++ b/profile-widget/divepixmapitem.cpp @@ -116,6 +116,6 @@ void DivePictureItem::mousePressEvent(QGraphicsSceneMouseEvent *event) void DivePictureItem::removePicture() { #ifndef SUBSURFACE_MOBILE - DivePictureModel::instance()->removePicture(fileUrl, true); + DivePictureModel::instance()->removePictures({ fileUrl }); #endif } -- cgit v1.2.3-70-g09d2