mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
statistics tab: use current_dive to decide whether user is freediving
This used the displayed_dive object. However, we now use current_dive to designate the currently displayed dive. Thus, use this instead. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5febb534b8
commit
326772cbdb
1 changed files with 5 additions and 7 deletions
|
@ -107,20 +107,18 @@ void TabDiveStatistics::updateData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool is_freedive = current_dive && current_dive->dc.divemode == FREEDIVE;
|
||||||
ui->divesAllText->setText(QString::number(stats_selection.selection_size));
|
ui->divesAllText->setText(QString::number(stats_selection.selection_size));
|
||||||
ui->totalTimeAllText->setText(get_dive_duration_string(stats_selection.total_time.seconds, tr("h"), tr("min"), tr("sec"),
|
ui->totalTimeAllText->setText(get_dive_duration_string(stats_selection.total_time.seconds, tr("h"), tr("min"), tr("sec"), " ", is_freedive));
|
||||||
" ", displayed_dive.dc.divemode == FREEDIVE));
|
|
||||||
|
|
||||||
int seconds = stats_selection.total_time.seconds;
|
int seconds = stats_selection.total_time.seconds;
|
||||||
if (stats_selection.selection_size)
|
if (stats_selection.selection_size)
|
||||||
seconds /= stats_selection.selection_size;
|
seconds /= stats_selection.selection_size;
|
||||||
ui->timeLimits->setAverage(get_dive_duration_string(seconds, tr("h"), tr("min"), tr("sec"),
|
ui->timeLimits->setAverage(get_dive_duration_string(seconds, tr("h"), tr("min"), tr("sec"),
|
||||||
" ", displayed_dive.dc.divemode == FREEDIVE));
|
" ", is_freedive));
|
||||||
if (amount_selected > 1) {
|
if (amount_selected > 1) {
|
||||||
ui->timeLimits->setMaximum(get_dive_duration_string(stats_selection.longest_time.seconds, tr("h"), tr("min"), tr("sec"),
|
ui->timeLimits->setMaximum(get_dive_duration_string(stats_selection.longest_time.seconds, tr("h"), tr("min"), tr("sec"), " ", is_freedive));
|
||||||
" ", displayed_dive.dc.divemode == FREEDIVE));
|
ui->timeLimits->setMinimum(get_dive_duration_string(stats_selection.shortest_time.seconds, tr("h"), tr("min"), tr("sec"), " ", is_freedive));
|
||||||
ui->timeLimits->setMinimum(get_dive_duration_string(stats_selection.shortest_time.seconds, tr("h"), tr("min"), tr("sec"),
|
|
||||||
" ", displayed_dive.dc.divemode == FREEDIVE));
|
|
||||||
} else {
|
} else {
|
||||||
ui->timeLimits->setMaximum("");
|
ui->timeLimits->setMaximum("");
|
||||||
ui->timeLimits->setMinimum("");
|
ui->timeLimits->setMinimum("");
|
||||||
|
|
Loading…
Add table
Reference in a new issue