mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
Fix crash when entering a dive via dive-add on a empty table.
We were selecting garbage, not anymore. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
47c833015b
commit
612c5713b4
1 changed files with 2 additions and 0 deletions
|
@ -152,6 +152,8 @@ void DiveListView::unselectDives()
|
|||
|
||||
void DiveListView::selectDive(int i, bool scrollto, bool toggle)
|
||||
{
|
||||
if( i == -1)
|
||||
return;
|
||||
QSortFilterProxyModel *m = qobject_cast<QSortFilterProxyModel*>(model());
|
||||
QModelIndexList match = m->match(m->index(0,0), DiveTripModel::DIVE_IDX, i, 2, Qt::MatchRecursive);
|
||||
QItemSelectionModel::SelectionFlags flags;
|
||||
|
|
Loading…
Add table
Reference in a new issue