From 724af757224fb8ef4b1bc7e8ab73327fd7bc71ef Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 18 Sep 2022 13:49:29 +0200 Subject: [PATCH] desktop: disable extradata tab if no site selected Owing to bit-rot, the extradata tab was not disabled if no dive is selected. The reason was that there was an additional tab (dive-computers) that should not be disabled. However that tab was removed and now the extradata tab was not disabled. Fix this, but note that there is another of these 'parasitic' tabs, that should be removed, namely the dive-site tab. Signed-off-by: Berthold Stoeger --- desktop-widgets/tab-widgets/maintab.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 0eb7adc89..079902b3f 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -107,11 +107,11 @@ void MainTab::updateDiveInfo() if (DivePlannerPointsModel::instance()->isPlanner()) return; - // If there is no current dive, disable all widgets except the last two, - // which are the dive site tab and the dive computer tabs. - // TODO: Conceptually, these two shouldn't even be a tabs here! + // If there is no current dive, disable all widgets except the last one, + // which is the dive site tab + // TODO: Conceptually, this shouldn't even be a tab here! bool enabled = current_dive != nullptr; - for (int i = 0; i < extraWidgets.size() - 2; ++i) + for (int i = 0; i < extraWidgets.size() - 1; ++i) extraWidgets[i]->setEnabled(enabled); if (current_dive) {