summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-13 19:04:29 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-05-07 08:56:57 -0700
commit3b8b328639cd965c0664e2be4c981c4a8e5afd4d (patch)
treedaf98badff4b6fac431db66109ed7ce48553b81d /desktop-widgets
parent532449644eebd3011b47bff799305684bf75de65 (diff)
downloadsubsurface-3b8b328639cd965c0664e2be4c981c4a8e5afd4d.tar.gz
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>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/tab-widgets/TabDiveEquipment.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveEquipment.cpp b/desktop-widgets/tab-widgets/TabDiveEquipment.cpp
index 9399d3871..8a7fc63b5 100644
--- a/desktop-widgets/tab-widgets/TabDiveEquipment.cpp
+++ b/desktop-widgets/tab-widgets/TabDiveEquipment.cpp
@@ -130,7 +130,8 @@ void TabDiveEquipment::updateData()
suitModel.updateModel();
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);
else
ui.cylinders->view()->hideColumn(CylindersModel::USE);