From 4d26e3a0cbb57d9d0d80e68c783dbd69d5cca794 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 9 Jan 2015 12:21:20 -0800 Subject: Dive d/l selection UI: fix the row count ranges Yet another bug because the indices are inclusive. We need to start off with the last being smaller than first and we need to adjust the row count. It might be easier to just fix thing to make last be exclusive... Signed-off-by: Dirk Hohndel --- qt-ui/downloadfromdivecomputer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-ui/downloadfromdivecomputer.cpp') diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index c0c8e8b1c..5ac39ebf3 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -527,7 +527,7 @@ void DownloadThread::run() } DiveImportedModel::DiveImportedModel(QObject *o) : QAbstractTableModel(o), - lastIndex(0), + lastIndex(-1), firstIndex(0), checkStates(0) { @@ -540,7 +540,7 @@ int DiveImportedModel::columnCount(const QModelIndex &model) const int DiveImportedModel::rowCount(const QModelIndex &model) const { - return lastIndex - firstIndex; + return lastIndex - firstIndex + 1; } QVariant DiveImportedModel::headerData(int section, Qt::Orientation orientation, int role) const -- cgit v1.2.3-70-g09d2