summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-11-18 18:19:29 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-19 21:13:40 -0800
commit9f573df971d84a54d5b5daba73a2f9e1498d7ee2 (patch)
tree69c09d487b9f20d45ad1b49fbcda992bfac886bf
parentecb517d49678e1d2e2dfdbcca5819d81b1f288ea (diff)
downloadsubsurface-9f573df971d84a54d5b5daba73a2f9e1498d7ee2.tar.gz
Dive list: update selection after clearing model
When clearing the model the selection is cleared. Send the according signal. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--core/subsurface-qt/DiveListNotifier.h1
-rw-r--r--qt-models/divetripmodel.cpp1
2 files changed, 2 insertions, 0 deletions
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<dive *> &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();
}