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>
This commit is contained in:
Miika Turkia 2015-01-27 06:33:34 +02:00 committed by Dirk Hohndel
parent 7825495620
commit d5d42982b8

View file

@ -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