Skip to content

Commit

Permalink
desktop: query DivePlannerPointsModel for planner state
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bstoeger authored and dirkhh committed Apr 2, 2021
1 parent b4c307c commit ed8ad9a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions desktop-widgets/tab-widgets/maintab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ed8ad9a

Please sign in to comment.