mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
fc06a69c43
commit
d7a19b318e
1 changed files with 1 additions and 2 deletions
|
@ -391,10 +391,9 @@ void DiveListView::reloadHeaderActions()
|
||||||
}
|
}
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
} else {
|
} else {
|
||||||
// Skip first QAction item ( static text Visible )
|
|
||||||
for(int i = 0; i < model()->columnCount(); i++) {
|
for(int i = 0; i < model()->columnCount(); i++) {
|
||||||
QString title = QString("%1").arg(model()->headerData(i, Qt::Horizontal).toString());
|
QString title = QString("%1").arg(model()->headerData(i, Qt::Horizontal).toString());
|
||||||
header()->actions()[i+1]->setText( title );
|
header()->actions()[i]->setText(title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue