From b35e48c68e861039e338597f3c258ede7812c175 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 31 May 2015 17:44:32 -0300 Subject: Fix off-by-one error i is one greater than the number of dive_sites, use the correct nr. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-models/divelocationmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-models') diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp index 164d85d95..a2b5606b7 100644 --- a/qt-models/divelocationmodel.cpp +++ b/qt-models/divelocationmodel.cpp @@ -42,8 +42,8 @@ void LocationInformationModel::update() endRemoveRows(); } if (i) { - beginInsertRows(QModelIndex(), 0, i); - internalRowCount = i; + beginInsertRows(QModelIndex(), 0, i-1); + internalRowCount = i-1; endInsertRows(); } } -- cgit v1.2.3-70-g09d2