From 3b8b328639cd965c0664e2be4c981c4a8e5afd4d Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 13 Apr 2020 19:04:29 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- desktop-widgets/tab-widgets/TabDiveEquipment.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'desktop-widgets') 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); -- cgit v1.2.3-70-g09d2