From d5d42982b8ce098a720d6a715fb28529eda5364a Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Tue, 27 Jan 2015 06:33:34 +0200 Subject: Fix (un)selecting of downloaded dives Last index was not included in the selecting or unselecting the downloaded dives. Fixes #819 Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- qt-ui/downloadfromdivecomputer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'qt-ui/downloadfromdivecomputer.cpp') diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index c66792550..6fa83e118 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -599,14 +599,14 @@ void DiveImportedModel::changeSelected(QModelIndex clickedIndex) void DiveImportedModel::selectAll() { - memset(checkStates, true, lastIndex - firstIndex); - dataChanged(index(0, 0), index(0, lastIndex - firstIndex - 1), QVector() << Qt::CheckStateRole); + memset(checkStates, true, lastIndex - firstIndex + 1); + dataChanged(index(0, 0), index(0, lastIndex - firstIndex), QVector() << Qt::CheckStateRole); } void DiveImportedModel::selectNone() { - memset(checkStates, false, lastIndex - firstIndex); - dataChanged(index(0, 0), index(0, lastIndex - firstIndex - 1), QVector() << Qt::CheckStateRole); + memset(checkStates, false, lastIndex - firstIndex + 1); + dataChanged(index(0, 0), index(0, lastIndex - firstIndex), QVector() << Qt::CheckStateRole); } Qt::ItemFlags DiveImportedModel::flags(const QModelIndex &index) const -- cgit v1.2.3-70-g09d2