Last index was not included in the selecting or unselecting the
downloaded dives.

Fixes #819

Signed-off-by: Miika Turkia <[email protected]>
---
 qt-ui/downloadfromdivecomputer.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/qt-ui/downloadfromdivecomputer.cpp 
b/qt-ui/downloadfromdivecomputer.cpp
index c667925..6fa83e1 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<int>() << Qt::CheckStateRole);
+       memset(checkStates, true, lastIndex - firstIndex + 1);
+       dataChanged(index(0, 0), index(0, lastIndex - firstIndex), 
QVector<int>() << Qt::CheckStateRole);
 }
 
 void DiveImportedModel::selectNone()
 {
-       memset(checkStates, false, lastIndex - firstIndex);
-       dataChanged(index(0, 0), index(0, lastIndex - firstIndex - 1), 
QVector<int>() << Qt::CheckStateRole);
+       memset(checkStates, false, lastIndex - firstIndex + 1);
+       dataChanged(index(0, 0), index(0, lastIndex - firstIndex), 
QVector<int>() << Qt::CheckStateRole);
 }
 
 Qt::ItemFlags DiveImportedModel::flags(const QModelIndex &index) const
-- 
1.9.1

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to