Statistics: un-globalize stats_selection

The statistics of the selected dives were calculated
a) into a global objects and
b) at a completely different place than where they're used.

There's no plausible reason for either. There fore render
into a caller-provided structure at the place of use.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-10-06 16:30:57 +02:00 committed by Dirk Hohndel
parent 97991e2b9f
commit b61f6f66d8
4 changed files with 9 additions and 11 deletions

View file

@ -44,6 +44,8 @@ void TabDiveStatistics::clear()
void TabDiveStatistics::updateData()
{
stats_t stats_selection;
calculate_stats_selected(&stats_selection);
clear();
ui->depthLimits->setMaximum(get_depth_string(stats_selection.max_depth, true));
if (amount_selected > 1)

View file

@ -424,8 +424,6 @@ void MainTab::updateDiveInfo(bool clear)
setEnabled(false);
editMode = IGNORE; // don't trigger on changes to the widgets
process_selected_dives();
for (auto widget : extraWidgets) {
widget->updateData();
}