desktop: update tab info only if current_dive is set

If current_dive was not set, the code would clear the tabs
right after updating the data. We might just as well set the
data only if current_dive is set.

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:01:36 +02:00 committed by Dirk Hohndel
parent 326772cbdb
commit 532449644e

View file

@ -355,10 +355,10 @@ void MainTab::updateDiveInfo()
ignoreInput = true; // don't trigger on changes to the widgets
for (TabBase *widget: extraWidgets)
widget->updateData();
if (current_dive) {
for (TabBase *widget: extraWidgets)
widget->updateData();
// If we're on the dive-site tab, we don't want to switch tab when entering / exiting
// trip mode. The reason is that
// 1) this disrupts the user-experience and