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>
This commit is contained in:
Stefan Fuchs 2017-12-13 19:32:29 +01:00 committed by Dirk Hohndel
parent ef543da5af
commit 2890be9256
2 changed files with 3 additions and 2 deletions

View file

@ -2000,7 +2000,7 @@ void ProfileWidget2::plotPictures()
double x, y, lastX = -1.0, lastY = -1.0;
DivePictureModel *m = DivePictureModel::instance();
for (int i = m->rowDDStart; i <= m->rowDDEnd; i++) {
for (int i = m->rowDDStart; i < m->rowDDEnd; i++) {
int offsetSeconds = m->index(i, 1).data(Qt::UserRole).value<int>();
// it's a correct picture, but doesn't have a timestamp: only show on the widget near the
// information area.