From d7a19b318e3e99015971943d181f0899054fe1a4 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Wed, 4 Dec 2013 18:20:33 +0200 Subject: [PATCH] Divelist: fix a crash when updating the preferences Hitting apply in the preferences dialog causes a QList assert. This led to DiveListView::reloadHeaderActions(), where we have an out of range access. Patch makes the column count match the header action count. Signed-off-by: Lubomir I. Ivanov Signed-off-by: Dirk Hohndel --- qt-ui/divelistview.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 27027c84b..dc1420f64 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -391,10 +391,9 @@ void DiveListView::reloadHeaderActions() } s.endGroup(); } else { - // Skip first QAction item ( static text Visible ) for(int i = 0; i < model()->columnCount(); i++) { QString title = QString("%1").arg(model()->headerData(i, Qt::Horizontal).toString()); - header()->actions()[i+1]->setText( title ); + header()->actions()[i]->setText(title); } } }