summaryrefslogtreecommitdiffstats
path: root/profile-widget/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-01 15:36:20 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-01 15:37:28 -0800
commit63eff39edd2b97d80720a6198b2825a853372b15 (patch)
tree13aff0739d19dd10cb66a9b6ec44130c221d49c3 /profile-widget/profilewidget2.cpp
parent3f72500f87cc2824b468f62c1a4bef524ceadfff (diff)
downloadsubsurface-63eff39edd2b97d80720a6198b2825a853372b15.tar.gz
QML-UI: turn of some profile features
We don't have a tooltip on the QML UI as it's rendered into a pixmal. We also don't need the timer as we don't need the TTS calculations. And we don't need the acrobatics to figure out if we're in the planner as we don't support the visual planner (or any planner, at this point) with the mobile UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile-widget/profilewidget2.cpp')
-rw-r--r--profile-widget/profilewidget2.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 2306a2831..1e8f38ed6 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -501,9 +501,10 @@ void ProfileWidget2::resetZoom()
void ProfileWidget2::plotDive(struct dive *d, bool force)
{
static bool firstCall = true;
+#ifndef SUBSURFACE_MOBILE
QTime measureDuration; // let's measure how long this takes us (maybe we'll turn of TTL calculation later
measureDuration.start();
-
+#endif
if (currentState != ADD && currentState != PLAN) {
if (!d) {
if (selected_dive == -1)
@@ -549,10 +550,11 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
// restore default zoom level
resetZoom();
+#ifndef SUBSURFACE_MOBILE
// reset some item visibility on printMode changes
toolTipItem->setVisible(!printMode);
rulerItem->setVisible(prefs.rulergraph && !printMode && currentState != PLAN && currentState != ADD);
-
+#endif
if (currentState == EMPTY)
setProfileState();
@@ -598,8 +600,9 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
}
dataModel->setDive(&displayed_dive, plotInfo);
+#ifndef SUBSURFACE_MOBILE
toolTipItem->setPlotInfo(plotInfo);
-
+#endif
// It seems that I'll have a lot of boilerplate setting the model / axis for
// each item, I'll mostly like to fix this in the future, but I'll keep at this for now.
profileYAxis->setMaximum(maxdepth);
@@ -699,6 +702,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
// OK, how long did this take us? Anything above the second is way too long,
// so if we are calculation TTS / NDL then let's force that off.
+#ifndef SUBSURFACE_MOBILE
if (measureDuration.elapsed() > 1000 && prefs.calcndltts) {
prefs.calcndltts = false;
QSettings s;
@@ -706,6 +710,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
s.setValue("calcndltts", false);
report_error(qPrintable(tr("Show NDL / TTS was disabled because of excessive processing time")));
}
+#endif
emit showError();
}