From d16bff13bb076e344342f9dbd0f1974e0164c7cf Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 8 Jan 2015 11:27:47 -0800 Subject: 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 --- qt-ui/downloadfromdivecomputer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-ui') 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() << Qt::CheckStateRole); return true; } -- cgit v1.2.3-70-g09d2