diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-01-27 06:33:34 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-26 21:33:05 -0800 |
commit | d5d42982b8ce098a720d6a715fb28529eda5364a (patch) | |
tree | 98e9c0dc177d34952fba3b0e4a62d76c2ee5f83a /qt-ui | |
parent | 7825495620539d21fce993310cce022feb9181f2 (diff) | |
download | subsurface-d5d42982b8ce098a720d6a715fb28529eda5364a.tar.gz |
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 <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/downloadfromdivecomputer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<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 |