summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-02-10 22:23:16 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-02-10 14:33:15 -0800
commit646aead629eb9005c6c86484774022aef84fea2b (patch)
tree5584e75eaec0a81513f94dad8178723bef0a2d1b /desktop-widgets
parentb3e4c9c8daee8df29c7d6fc943e37886217d3c98 (diff)
downloadsubsurface-646aead629eb9005c6c86484774022aef84fea2b.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/divelistview.cpp5
1 files changed, 5 insertions, 0 deletions
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<QModelIndex> &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;