diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-01-08 11:27:47 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-08 11:27:47 -0800 |
commit | d16bff13bb076e344342f9dbd0f1974e0164c7cf (patch) | |
tree | d41296643162c3c914b671670da370757de64447 /qt-ui | |
parent | 32824e8db8469187bf4358d91d4e1bb1ec5c925d (diff) | |
download | subsurface-d16bff13bb076e344342f9dbd0f1974e0164c7cf.tar.gz |
Dive d/l selection UI: fix more array access errors
The checked array is zero based, reflecting the rows shown.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/downloadfromdivecomputer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index a36db7daf..671225b86 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -570,7 +570,7 @@ QVariant DiveImportedModel::data(const QModelIndex &index, int role) const } if (role == Qt::CheckStateRole) { if (index.column() == 0) - return checkStates[index.row() + firstIndex] ? Qt::Checked : Qt::Unchecked; + return checkStates[index.row()] ? Qt::Checked : Qt::Unchecked; } return QVariant(); } @@ -586,7 +586,7 @@ bool DiveImportedModel::setData(const QModelIndex &index, const QVariant &value, if (role != Qt::CheckStateRole) return false; - checkStates[index.row() + firstIndex] = value.toBool(); + checkStates[index.row()] = value.toBool(); dataChanged(index, index, QVector<int>() << Qt::CheckStateRole); return true; } |