selection: move dive selection, current dive and dc through signals

To reduce access of global variables.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-09-03 22:45:08 +02:00 committed by bstoeger
parent 616dbd9671
commit 72a15c46d9
10 changed files with 47 additions and 36 deletions

View file

@ -202,7 +202,7 @@ void setSelection(const std::vector<dive *> &selection, dive *currentDive, int c
auto selectedDives = setSelectionCore(selection, currentDive, currentDc);
// Send the new selection to the UI.
emit diveListNotifier.divesSelected(selectedDives, current_dive);
emit diveListNotifier.divesSelected(selectedDives, current_dive, currentDc);
}
// Set selection, but try to keep the current dive. If current dive is not in selection,

View file

@ -111,7 +111,8 @@ signals:
void tripChanged(dive_trip *trip, TripField field);
// Selection changes
void divesSelected(const QVector<dive *> &dives, dive *currentDive);
// currentDC == -1 -> keep current dive computer
void divesSelected(const QVector<dive *> &dives, dive *currentDive, int currentDC);
void tripSelected(dive_trip *trip, dive *currentDive);
// Dive site signals. Add and delete events are sent per dive site and