diff options
-rw-r--r-- | desktop-widgets/divelistview.cpp | 7 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index 09c69c2a8..c4f778a92 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -194,6 +194,10 @@ void DiveListView::reset() // If items were selected, inform the selection model void DiveListView::diveSelectionChanged(const QVector<QModelIndex> &indexes) { + // Since dives are selected dive-by-dive, send only a single signal at the + // end, not one for every dive. + dontEmitDiveChangedSignal = true; + clearSelection(); MultiFilterSortModel *m = MultiFilterSortModel::instance(); QItemSelectionModel *s = selectionModel(); @@ -217,6 +221,9 @@ void DiveListView::diveSelectionChanged(const QVector<QModelIndex> &indexes) setAnimated(true); } } + + dontEmitDiveChangedSignal = false; + emit divesSelected(); } void DiveListView::currentDiveChanged(QModelIndex index) diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 8dc0f94b5..2a1e879a8 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -191,7 +191,6 @@ MainWindow::MainWindow() : QMainWindow(), if (!QIcon::hasThemeIcon("window-close")) { QIcon::setThemeName("subsurface"); } - connect(&diveListNotifier, &DiveListNotifier::divesSelected, this, &MainWindow::selectionChanged); connect(diveList, &DiveListView::divesSelected, this, &MainWindow::selectionChanged); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(readSettings())); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), diveList, SLOT(update())); |