From 646aead629eb9005c6c86484774022aef84fea2b Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 10 Feb 2021 22:23:16 +0100 Subject: desktop: disable animation when selecting multiple dives Selecting many dives when the animation was active was increadibly slow, so disable it. Signed-off-by: Berthold Stoeger --- desktop-widgets/divelistview.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'desktop-widgets') diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index c08998e5f..94acfc8d2 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -248,11 +248,16 @@ void DiveListView::diveSelectionChanged(const QVector &indices) if (std::find(affectedTrips.begin(), affectedTrips.end(), row) == affectedTrips.end()) affectedTrips.push_back(row); } + // Disable animations when expanding trips. Otherwise, selection of + // a large number of dives becomes increadibly slow. + bool oldAnimated = isAnimated(); + setAnimated(false); MultiFilterSortModel *m = MultiFilterSortModel::instance(); for (int row: affectedTrips) { QModelIndex idx = m->index(row, 0); expand(idx); } + setAnimated(oldAnimated); selectionChangeDone(); programmaticalSelectionChange = false; -- cgit v1.2.3-70-g09d2