desktop: use current_dive instead of displayed_dive on equipment tab

Since the displayed data is extracted from current_dive it makes no
sense to query displayed_dive for the dive mode.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Berthold Stoeger 2020-04-13 19:04:29 +02:00 committed by Dirk Hohndel
parent 532449644e
commit 3b8b328639

View file

@ -130,7 +130,8 @@ void TabDiveEquipment::updateData()
suitModel.updateModel(); suitModel.updateModel();
ui.cylinders->view()->hideColumn(CylindersModel::DEPTH); ui.cylinders->view()->hideColumn(CylindersModel::DEPTH);
if (get_dive_dc(&displayed_dive, dc_number)->divemode == CCR) bool is_ccr = current_dive && get_dive_dc(current_dive, dc_number)->divemode == CCR;
if (is_ccr)
ui.cylinders->view()->showColumn(CylindersModel::USE); ui.cylinders->view()->showColumn(CylindersModel::USE);
else else
ui.cylinders->view()->hideColumn(CylindersModel::USE); ui.cylinders->view()->hideColumn(CylindersModel::USE);