summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-08 11:27:47 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-08 11:27:47 -0800
commitd16bff13bb076e344342f9dbd0f1974e0164c7cf (patch)
treed41296643162c3c914b671670da370757de64447 /qt-ui
parent32824e8db8469187bf4358d91d4e1bb1ec5c925d (diff)
downloadsubsurface-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.cpp4
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;
}