Expand the trip of the newly selected dive.

I hit this bug on deleting dives and the newly selected
one got inside a trip, that wasn't expanded. anyway, easy one.
:)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2013-11-16 18:54:14 -02:00 committed by Dirk Hohndel
parent 8476ea5ea8
commit 4f1cae7a2f

View file

@ -159,6 +159,11 @@ void DiveListView::selectDive(int i, bool scrollto, bool toggle)
flags = toggle ? QItemSelectionModel::Toggle : QItemSelectionModel::Select;
flags |= QItemSelectionModel::Rows;
selectionModel()->select(idx, flags);
if(idx.parent().isValid()){
setAnimated(false);
expand(idx.parent());
setAnimated(true);
}
if (scrollto)
scrollTo(idx, PositionAtCenter);
}