summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/templatelayout.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2016-01-07 16:01:24 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-08 08:04:44 -0800
commit25aa80846b84c0b3cd3e0b0256a046e1e92fb1db (patch)
treec9934f39f2e039e5877af7ee0d3b0d96c5a1debf /desktop-widgets/templatelayout.h
parentc022f5c4f71f3e7670ed458d714d96fd6e88c55b (diff)
downloadsubsurface-25aa80846b84c0b3cd3e0b0256a046e1e92fb1db.tar.gz
Move Dive class from qthelper.h/cpp to it's own file
and rename it to DiveObjectHelper, since it should be an QObject based class to make it easier on the QML, grantlee and widgets side to display the dive's internal data. each Q_PROPERTY defined in the DiveObjectHelper.h file can be acessed directly via it's name. So, if you are on a model that returns a dive, acess it's name by dive.name 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.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop-widgets/templatelayout.h b/desktop-widgets/templatelayout.h
index 1ef9b5834..6f4478a08 100644
--- a/desktop-widgets/templatelayout.h
+++ b/desktop-widgets/templatelayout.h
@@ -7,6 +7,7 @@
#include "statistics.h"
#include "qthelper.h"
#include "helpers.h"
+#include "subsurface-core/subsurface-qt/DiveObjectHelper.h"
int getTotalWork(print_options *printOptions);
void find_all_templates();
@@ -44,7 +45,6 @@ public:
~YearInfo();
};
-Q_DECLARE_METATYPE(Dive)
Q_DECLARE_METATYPE(template_options)
Q_DECLARE_METATYPE(print_options)
Q_DECLARE_METATYPE(YearInfo)
@@ -59,7 +59,7 @@ Q_DECLARE_METATYPE(YearInfo)
#define _RETURN_DIVE_PROPERTY_IDX(prop, idx) \
if (property == _CONC_STR(prop, idx)) return object.prop(idx)
-GRANTLEE_BEGIN_LOOKUP(Dive)
+GRANTLEE_BEGIN_LOOKUP(DiveObjectHelper)
_RETURN_DIVE_PROPERTY(number);
else _RETURN_DIVE_PROPERTY(id);
else _RETURN_DIVE_PROPERTY(date);