summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelistview.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-11-16 18:54:14 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-16 20:23:33 -0800
commit4f1cae7a2fa1ebcf8bcdb86acdc36c73de73f186 (patch)
tree511acfb5dc7ab410e958ae5683792b1207800451 /qt-ui/divelistview.cpp
parent8476ea5ea80deaf7e73065870cddf6b2ec4f96e7 (diff)
downloadsubsurface-4f1cae7a2fa1ebcf8bcdb86acdc36c73de73f186.tar.gz
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>
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r--qt-ui/divelistview.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index df8bd44f6..44bb78cae 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -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);
}