From 9f573df971d84a54d5b5daba73a2f9e1498d7ee2 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 18 Nov 2019 18:19:29 +0100 Subject: Dive list: update selection after clearing model When clearing the model the selection is cleared. Send the according signal. Signed-off-by: Berthold Stoeger --- core/subsurface-qt/DiveListNotifier.h | 1 + qt-models/divetripmodel.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/core/subsurface-qt/DiveListNotifier.h b/core/subsurface-qt/DiveListNotifier.h index e63738512..d4045abea 100644 --- a/core/subsurface-qt/DiveListNotifier.h +++ b/core/subsurface-qt/DiveListNotifier.h @@ -82,6 +82,7 @@ signals: // Trip edited signal void tripChanged(dive_trip *trip, TripField field); + // Selection changes void divesSelected(const QVector &dives, dive *current); // Dive site signals. Add and delete events are sent per dive site and diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index 2a83b61da..d2e6a634d 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -376,6 +376,7 @@ void DiveTripModelBase::clear() { beginResetModel(); clear_dive_file_data(); + emit diveListNotifier.divesSelected({}, nullptr); // Inform profile, etc of changed selection endResetModel(); } -- cgit v1.2.3-70-g09d2