summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/templatelayout.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2016-01-08 11:59:34 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-08 08:05:36 -0800
commita13fa83046aa2b7733fedbb83b5441090be042a9 (patch)
treeb618bda42855faaceca226d7eaba2e6a35b132a7 /desktop-widgets/templatelayout.h
parent19dee335e457433e9a3f215e35a60e282a383a11 (diff)
downloadsubsurface-a13fa83046aa2b7733fedbb83b5441090be042a9.tar.gz
Removed grantlee template code to deal with non-Qobject
Since we alreday have a Q_PROPERTY on the DiveObjectHelper, grantlee introspection can use that directly to access it's data, so there's no need for us to redeclare everything. More QObject Introspection, Less handmade boilerplate for Grantlee, QML, and a few other things. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/templatelayout.h')
-rw-r--r--desktop-widgets/templatelayout.h54
1 files changed, 0 insertions, 54 deletions
diff --git a/desktop-widgets/templatelayout.h b/desktop-widgets/templatelayout.h
index 6f4478a08..9e420f381 100644
--- a/desktop-widgets/templatelayout.h
+++ b/desktop-widgets/templatelayout.h
@@ -49,60 +49,6 @@ Q_DECLARE_METATYPE(template_options)
Q_DECLARE_METATYPE(print_options)
Q_DECLARE_METATYPE(YearInfo)
-#define _CONC_STR(prop, idx) _CONC_STR1(prop, idx)
-#define _CONC_STR1(prop, idx) _CONC_STR2(prop ## idx)
-#define _CONC_STR2(prop) #prop
-
-#define _RETURN_DIVE_PROPERTY(prop) \
- if (property == #prop) return object.prop()
-
-#define _RETURN_DIVE_PROPERTY_IDX(prop, idx) \
- if (property == _CONC_STR(prop, idx)) return object.prop(idx)
-
-GRANTLEE_BEGIN_LOOKUP(DiveObjectHelper)
-_RETURN_DIVE_PROPERTY(number);
-else _RETURN_DIVE_PROPERTY(id);
-else _RETURN_DIVE_PROPERTY(date);
-else _RETURN_DIVE_PROPERTY(time);
-else _RETURN_DIVE_PROPERTY(location);
-else _RETURN_DIVE_PROPERTY(duration);
-else _RETURN_DIVE_PROPERTY(depth);
-else _RETURN_DIVE_PROPERTY(buddy);
-else _RETURN_DIVE_PROPERTY(divemaster);
-else _RETURN_DIVE_PROPERTY(airTemp);
-else _RETURN_DIVE_PROPERTY(waterTemp);
-else _RETURN_DIVE_PROPERTY(notes);
-else _RETURN_DIVE_PROPERTY(rating);
-else _RETURN_DIVE_PROPERTY(sac);
-else _RETURN_DIVE_PROPERTY(tags);
-else _RETURN_DIVE_PROPERTY(gas);
-else _RETURN_DIVE_PROPERTY(suit);
-else _RETURN_DIVE_PROPERTY(cylinders);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 0);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 1);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 2);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 3);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 4);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 5);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 6);
-else _RETURN_DIVE_PROPERTY_IDX(cylinder, 7);
-else _RETURN_DIVE_PROPERTY(weights);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 0);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 1);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 2);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 3);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 4);
-else _RETURN_DIVE_PROPERTY_IDX(weight, 5);
-else _RETURN_DIVE_PROPERTY(maxcns);
-else _RETURN_DIVE_PROPERTY(otu);
-GRANTLEE_END_LOOKUP
-
-#undef _RETURN_DIVE_PROPERTY
-#undef _RETURN_DIVE_PROPERTY_IDX
-#undef _CONC_STR
-#undef _CONC_STR1
-#undef _CONC_STR2
-
GRANTLEE_BEGIN_LOOKUP(template_options)
if (property == "font") {
switch (object.font_index) {