selection: move current dc logic to profile widget

The current dc global makes no sense on mobile. Therefore,
move the logic of the currently displayed dive computer
to the profile widget and remove the dc_number global
variable.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-09-17 19:07:35 +02:00 committed by bstoeger
parent 19baae449d
commit cad80e5a53
10 changed files with 92 additions and 66 deletions

View file

@ -527,7 +527,7 @@ void DiveListView::selectionChanged(const QItemSelection &selected, const QItemS
std::vector<dive *> selection = getDiveSelection();
updateSelection(selection, addToSelection, removeFromSelection);
dive *newCurrent = selection.empty() ? nullptr : selection.front();
setSelectionCore(selection, newCurrent, -1);
setSelectionCore(selection, newCurrent);
// Display the new, processed, selection
QTreeView::selectionChanged(selectionModel()->selection(), newDeselected);