mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Statistics: remove global state / calculate only when needed
Statistics were calculated into global variables every time the current dive was changed. Calculate statistics only when needed and into a structure provided by the caller. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
68fdc0b6f4
commit
97991e2b9f
7 changed files with 141 additions and 107 deletions
|
@ -424,13 +424,7 @@ void MainTab::updateDiveInfo(bool clear)
|
|||
setEnabled(false);
|
||||
editMode = IGNORE; // don't trigger on changes to the widgets
|
||||
|
||||
// This method updates ALL tabs whenever a new dive or trip is
|
||||
// selected.
|
||||
// If exactly one trip has been selected, we show the location / notes
|
||||
// for the trip in the Info tab, otherwise we show the info of the
|
||||
// selected_dive
|
||||
process_selected_dives();
|
||||
process_all_dives();
|
||||
|
||||
for (auto widget : extraWidgets) {
|
||||
widget->updateData();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue