summaryrefslogtreecommitdiffstats
path: root/subsurface-core/subsurface-qt/DiveObjectHelper.h
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2016-02-29 16:42:07 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-29 07:33:31 -0800
commit1d06c383a207b19dadd58f7975cd574df7a1c5ac (patch)
treed5d156195e0c700d3b4987a333296d4da40e3f89 /subsurface-core/subsurface-qt/DiveObjectHelper.h
parent0aa8ef918df62399f621bc591528535ed550eaa2 (diff)
downloadsubsurface-1d06c383a207b19dadd58f7975cd574df7a1c5ac.tar.gz
DiveHelperObject: add the weightList and cylinderList properties
"weights" and "cylinders" are QStringList Q_PROPERTIES, and Grantlee should be able to render them, but it doesn't. To be able to print the whole list of weights and cylinders we introduce two new QString properties "weightList" and "cylinderList". The variable replacement in the previous patch deals with the conversation of the user side HTML, e.g.: USER -> INTERNAL "{{ dive.weights }} -> {{ dive.weightList }}" "{{ dive.cylinders }} -> {{ dive.cylinderList }}" Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/subsurface-qt/DiveObjectHelper.h')
-rw-r--r--subsurface-core/subsurface-qt/DiveObjectHelper.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.h b/subsurface-core/subsurface-qt/DiveObjectHelper.h
index 0584f8836..602775ef8 100644
--- a/subsurface-core/subsurface-qt/DiveObjectHelper.h
+++ b/subsurface-core/subsurface-qt/DiveObjectHelper.h
@@ -26,9 +26,11 @@ class DiveObjectHelper : public QObject {
Q_PROPERTY(QString tags READ tags CONSTANT)
Q_PROPERTY(QString gas READ gas CONSTANT)
Q_PROPERTY(QString sac READ sac CONSTANT)
+ Q_PROPERTY(QString weightList READ weightList CONSTANT)
Q_PROPERTY(QStringList weights READ weights CONSTANT)
Q_PROPERTY(bool singleWeight READ singleWeight CONSTANT)
Q_PROPERTY(QString suit READ suit CONSTANT)
+ Q_PROPERTY(QString cylinderList READ cylinderList CONSTANT)
Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)
Q_PROPERTY(QString trip READ trip CONSTANT)
Q_PROPERTY(QString tripMeta READ tripMeta CONSTANT)
@@ -61,10 +63,12 @@ public:
QString tags() const;
QString gas() const;
QString sac() const;
+ QString weightList() const;
QStringList weights() const;
QString weight(int idx) const;
bool singleWeight() const;
QString suit() const;
+ QString cylinderList() const;
QStringList cylinders() const;
QString cylinder(int idx) const;
QString trip() const;