Setting dive as 'current' when restoring selection

Restoring the selection was not setting the selected dive as current, and
thus, breaking keyboard navigation.

Fixes #402

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-01-06 20:13:21 -02:00 committed by Dirk Hohndel
parent ddecc3b56a
commit ca391035f3

View file

@ -203,7 +203,7 @@ void DiveListView::selectDive(int i, bool scrollto, bool toggle)
QModelIndex idx = match.first();
flags = toggle ? QItemSelectionModel::Toggle : QItemSelectionModel::Select;
flags |= QItemSelectionModel::Rows;
selectionModel()->select(idx, flags);
selectionModel()->setCurrentIndex(idx, flags);
if(idx.parent().isValid()){
setAnimated(false);
expand(idx.parent());