summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-03-22 15:13:58 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-23 17:24:40 -0700
commit8bc2ad14737eeb55368d19ab4d0b9735b7d35139 (patch)
tree1f5ec36e330c13af44d229a63c4a878d86d5eed5 /qt-ui/models.cpp
parentd4a1932276872954364a33d7f2b3ad0b16a1f38b (diff)
downloadsubsurface-8bc2ad14737eeb55368d19ab4d0b9735b7d35139.tar.gz
Enable parts of planner based on define
In bf205726 DEPTH/Switch at was disabled by commenting out that code. This puts it back behind ifdefs Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 1689139e1..5b011d747 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -67,7 +67,9 @@ CylindersModel::CylindersModel(QObject *parent) : current(0), rows(0)
{
// enum {REMOVE, TYPE, SIZE, WORKINGPRESS, START, END, O2, HE, DEPTH};
setHeaderDataStrings(QStringList() << "" << tr("Type") << tr("Size") << tr("WorkPress") << tr("StartPress") << tr("EndPress") << trUtf8("O" UTF8_SUBSCRIPT_2 "%") << tr("He%")
- // while the planner is disabled, we don't need this column: << tr("Switch at")
+#ifdef ENABLE_PLANNER
+ << tr("Switch at")
+#endif
);
}
@@ -143,9 +145,11 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const
case HE:
ret = percent_string(cyl->gasmix.he);
break;
- // case DEPTH:
- // ret = get_depth_string(cyl->depth, true);
- // break;
+#ifdef ENABLE_PLANNER
+ case DEPTH:
+ ret = get_depth_string(cyl->depth, true);
+ break;
+#endif
}
break;
case Qt::DecorationRole:
@@ -258,9 +262,13 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in
changed = true;
}
break;
- // case DEPTH:
- // if (CHANGED())
- // cyl->depth = string_to_depth(vString.toUtf8().data());
+#ifdef ENABLE_PLANNER
+ case DEPTH:
+ if (CHANGED()) {
+ cyl->depth = string_to_depth(vString.toUtf8().data());
+ changed = true;
+ }
+#endif
}
dataChanged(index, index);
if (addDiveMode)