summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelistview.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-12-04 18:20:33 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-04 10:43:54 -0800
commitd7a19b318e3e99015971943d181f0899054fe1a4 (patch)
tree5e703130a3bb92a4a4a07910fc0ed76e627d29c2 /qt-ui/divelistview.cpp
parentfc06a69c436f266f74bbdd141f508e1063ca7ba9 (diff)
downloadsubsurface-d7a19b318e3e99015971943d181f0899054fe1a4.tar.gz
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 <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r--qt-ui/divelistview.cpp3
1 files changed, 1 insertions, 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);
}
}
}