summaryrefslogtreecommitdiffstats
path: root/qt-models/divepicturemodel.cpp
diff options
context:
space:
mode:
authorGravatar Stefan Fuchs <sfuchs@gmx.de>2017-12-13 19:32:29 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-15 09:11:28 -0800
commit2890be92568d36303e99e84501994572c2a16c6e (patch)
treecf1ae19cbc241cf18ba8e60f7180a0eda611b299 /qt-models/divepicturemodel.cpp
parentef543da5aff296e4e4996a87e22165cf43ef2e87 (diff)
downloadsubsurface-2890be92568d36303e99e84501994572c2a16c6e.tar.gz
divepicturemodel: Reset start and end row for displayed_dive correctly
Correct way of using indices for rowDDstart and rowDDend. Reset rowDDstart and rowDDend at beginning of updating dive pictures. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'qt-models/divepicturemodel.cpp')
-rw-r--r--qt-models/divepicturemodel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-models/divepicturemodel.cpp b/qt-models/divepicturemodel.cpp
index 994eb674e..d886fd767 100644
--- a/qt-models/divepicturemodel.cpp
+++ b/qt-models/divepicturemodel.cpp
@@ -54,6 +54,7 @@ void DivePictureModel::updateDivePictures()
beginRemoveRows(QModelIndex(), 0, pictures.count() - 1);
pictures.clear();
endRemoveRows();
+ rowDDStart = rowDDEnd = 0;
}
// if the dive_table is empty, quit
@@ -69,7 +70,7 @@ void DivePictureModel::updateDivePictures()
FOR_EACH_PICTURE(dive)
pictures.push_back({picture, picture->filename, QImage(), picture->offset.seconds});
if (dive->id == displayed_dive.id)
- rowDDEnd = pictures.count() - 1;
+ rowDDEnd = pictures.count();
}
}
QtConcurrent::blockingMap(pictures, scaleImages);