[PATCH] Let cns and otu return ints rather than QStrings so they display correctly when accessed from grantlee template Fixes #1085
Tim Wootton
tim at tee-jay.org.uk
Mon Jul 18 15:08:27 PDT 2016
Signed-off-by: Tim Wootton <tim at tee-jay.org.uk>
---
core/subsurface-qt/DiveObjectHelper.cpp | 8 ++++----
core/subsurface-qt/DiveObjectHelper.h | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp
index fc406d6..1c7621e 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -306,14 +306,14 @@ QString DiveObjectHelper::tripMeta() const
return ret;
}
-QString DiveObjectHelper::maxcns() const
+int DiveObjectHelper::maxcns() const
{
- return QString(m_dive->maxcns);
+ return m_dive->maxcns;
}
-QString DiveObjectHelper::otu() const
+int DiveObjectHelper::otu() const
{
- return QString(m_dive->otu);
+ return m_dive->otu;
}
int DiveObjectHelper::rating() const
diff --git a/core/subsurface-qt/DiveObjectHelper.h b/core/subsurface-qt/DiveObjectHelper.h
index 6d95d75..ab42a59 100644
--- a/core/subsurface-qt/DiveObjectHelper.h
+++ b/core/subsurface-qt/DiveObjectHelper.h
@@ -36,8 +36,8 @@ class DiveObjectHelper : public QObject {
Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)
Q_PROPERTY(QString trip READ trip CONSTANT)
Q_PROPERTY(QString tripMeta READ tripMeta CONSTANT)
- Q_PROPERTY(QString maxcns READ maxcns CONSTANT)
- Q_PROPERTY(QString otu READ otu CONSTANT)
+ Q_PROPERTY(int maxcns READ maxcns CONSTANT)
+ Q_PROPERTY(int otu READ otu CONSTANT)
Q_PROPERTY(QString sumWeight READ sumWeight CONSTANT)
Q_PROPERTY(QString getCylinder READ getCylinder CONSTANT)
Q_PROPERTY(QString startPressure READ startPressure CONSTANT)
@@ -79,8 +79,8 @@ public:
QString cylinder(int idx) const;
QString trip() const;
QString tripMeta() const;
- QString maxcns() const;
- QString otu() const;
+ int maxcns() const;
+ int otu() const;
QString sumWeight() const;
QString getCylinder() const;
QString startPressure() const;
--
2.1.4
More information about the subsurface
mailing list