summaryrefslogtreecommitdiffstats
path: root/subsurface-helper.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2019-12-08 20:26:45 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-12-24 06:30:57 +0900
commit0c23e005ea421af415e124fff29c24a908b51ea3 (patch)
treea7fad48fb34336d96f41e737f1138c3f11984ab8 /subsurface-helper.cpp
parent3930cc42a562bf55f1cf9a0d115435d2cac83c98 (diff)
downloadsubsurface-0c23e005ea421af415e124fff29c24a908b51ea3.tar.gz
startup mobile: make diveplanner part of Qt type system
Register DivePlanner before starting QML. Signed-off-by: Jan Iversen <jan@casacondor.com>
Diffstat (limited to 'subsurface-helper.cpp')
-rw-r--r--subsurface-helper.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp
index d1c24c4cd..a19c52a2f 100644
--- a/subsurface-helper.cpp
+++ b/subsurface-helper.cpp
@@ -20,6 +20,7 @@
#include "qt-models/messagehandlermodel.h"
#include "profile-widget/qmlprofile.h"
#include "core/downloadfromdcthread.h"
+#include "core/plannershared.h"
#include "qt-models/diveimportedmodel.h"
#include "mobile-widgets/qml/kirigami/src/kirigamiplugin.h"
#else
@@ -183,6 +184,13 @@ void register_qml_types(QQmlEngine *engine)
int rc;
#ifdef SUBSURFACE_MOBILE
+ // register shared diveplanner class
+ if (engine != NULL) {
+ QQmlContext *ct = engine->rootContext();
+
+ ct->setContextProperty("Planner", plannerShared::instance());
+ }
+
REGISTER_TYPE(QMLManager, "QMLManager");
REGISTER_TYPE(QMLPrefs, "QMLPrefs");
REGISTER_TYPE(QMLProfile, "QMLProfile");