aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-02-21 19:10:14 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-04-02 13:53:23 -0700
commited8ad9ac807624b9fb87076e8a41cc2e47a5b076 (patch)
tree5ec74f45c8ff0979370649e03d3f6e4c850c6bb9 /desktop-widgets/tab-widgets
parentb4c307c775c6f1cd306094cb89ee53378b71c81e (diff)
downloadsubsurface-ed8ad9ac807624b9fb87076e8a41cc2e47a5b076.tar.gz
desktop: query DivePlannerPointsModel for planner state
MainTab::updateDiveInfo() is not executed when in the planner. To decide whether the application is in the planner state, it queried the profile. Instead, query the DivePlannerPointsModel. Currently, there is no autoritative carrier of that flag. However, the MainTab has a dependency on DivePlannerPointsModel anyway, and therefore this removes a dependency on the profile. This brings us closer to a state where we can have multiple profiles. Ultimately, it is hoped that the whole check can be removed at this place, making the point moot. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index b849a3ead..295b13b1d 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -13,7 +13,6 @@
#include "qt-models/diveplannermodel.h"
#include "desktop-widgets/divelistview.h"
#include "core/selection.h"
-#include "profile-widget/profilewidget2.h"
#include "desktop-widgets/diveplanner.h"
#include "qt-models/divecomputerextradatamodel.h"
#include "qt-models/divelocationmodel.h"
@@ -355,7 +354,7 @@ void MainTab::updateDiveInfo()
{
ui.location->refreshDiveSiteCache();
// don't execute this while adding / planning a dive
- if (editMode || MainWindow::instance()->graphics->isPlanner())
+ if (editMode || DivePlannerPointsModel::instance()->isPlanner())
return;
// If there is no current dive, disable all widgets except the last two,