From 52d5125926f430a86dc14a60911b04b8072c712a Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 14 Nov 2020 16:59:35 +0100 Subject: [PATCH] undo: add a general dives-imported signal Add a general dives-imported signal for those cases where we want to fully rebuild models, notably, the completion models. The divesAdded signals are too fine, because they are sent per trip and we don't want to reload these models multiple times per import. Signed-off-by: Berthold Stoeger --- commands/command_divelist.cpp | 2 ++ core/subsurface-qt/divelistnotifier.h | 1 + 2 files changed, 3 insertions(+) diff --git a/commands/command_divelist.cpp b/commands/command_divelist.cpp index 0917f71e5..b19075581 100644 --- a/commands/command_divelist.cpp +++ b/commands/command_divelist.cpp @@ -565,6 +565,8 @@ void ImportDives::redoit() emit diveListNotifier.filterPresetAdded(filterPresetsToRemove.back()); } filterPresetsToAdd.clear(); + + emit diveListNotifier.divesImported(); } void ImportDives::undoit() diff --git a/core/subsurface-qt/divelistnotifier.h b/core/subsurface-qt/divelistnotifier.h index 07750de90..2cd6eefcb 100644 --- a/core/subsurface-qt/divelistnotifier.h +++ b/core/subsurface-qt/divelistnotifier.h @@ -91,6 +91,7 @@ signals: void divesMovedBetweenTrips(dive_trip *from, dive_trip *to, bool deleteFrom, bool createTo, const QVector &dives); void divesChanged(const QVector &dives, DiveField field); void divesTimeChanged(timestamp_t delta, const QVector &dives); + void divesImported(); // A general signal when multiple dives have been imported. void cylindersReset(const QVector &dives); void cylinderAdded(dive *d, int pos);