summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2018-01-09 19:32:41 +0100
committerGravatar Jan Mulder <jlmulder@xs4all.nl>2018-01-10 21:28:02 +0100
commit9c01315d31e71c857a7a5ef34db6da7343b030ac (patch)
treec6a28fa2559810205cfc588c3854e0e9f8576542 /profile-widget
parent14e6c132c8c6a6f351af4af5d1dcc921eca1e4bb (diff)
downloadsubsurface-9c01315d31e71c857a7a5ef34db6da7343b030ac.tar.gz
Un-tie plannner model from profile on mobile
Do not pull in the DivePlannerPointsModel::instance as this is not used in the called function. We (currently) do not support deco computations on mobile, so trying to pull in any deco state from the planner is futile anyway. With this uncoupling, 6 more model files are not needed in mobile any more. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/profilewidget2.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 7445b745f..8cfdeadf7 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -606,8 +606,13 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
* so I'll *not* calculate everything if something is not being
* shown.
*/
+
plotInfo = calculate_max_limits_new(&displayed_dive, currentdc);
+#ifndef SUBSURFACE_MOBILE
create_plot_info_new(&displayed_dive, currentdc, &plotInfo, !shouldCalculateMaxDepth, &DivePlannerPointsModel::instance()->final_deco_state);
+#else
+ create_plot_info_new(&displayed_dive, currentdc, &plotInfo, !shouldCalculateMaxDepth, nullptr);
+#endif
int newMaxtime = get_maxtime(&plotInfo);
if (shouldCalculateMaxTime || newMaxtime > maxtime)
maxtime = newMaxtime;
@@ -1662,11 +1667,11 @@ void ProfileWidget2::editName()
void ProfileWidget2::disconnectTemporaryConnections()
{
+#ifndef SUBSURFACE_MOBILE
DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
disconnect(plannerModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(replot()));
disconnect(plannerModel, SIGNAL(cylinderModelEdited()), this, SLOT(replot()));
-#ifndef SUBSURFACE_MOBILE
disconnect(plannerModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
this, SLOT(pointInserted(const QModelIndex &, int, int)));
disconnect(plannerModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)),