summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r--qt-ui/divelistview.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index 89ee6a6e7..da4229de8 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -274,9 +274,15 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
}
}
setupUi();
- QModelIndex curr = selectionModel()->currentIndex();
- if (curr.parent().isValid() && !isExpanded(curr.parent()))
- expand(curr.parent());
+ if(selectedIndexes().count()){
+ QModelIndex curr = selectedIndexes().first();
+ curr = curr.parent().isValid() ? curr.parent() : curr;
+ if(!isExpanded(curr)){
+ setAnimated(false);
+ expand(curr);
+ setAnimated(true);
+ }
+ }
}
void DiveListView::reloadHeaderActions()