startup mobile: make diveplanner part of Qt type system

Register DivePlanner before starting QML.

Signed-off-by: Jan Iversen <jan@casacondor.com>
This commit is contained in:
jan Iversen 2019-12-08 20:26:45 +01:00 committed by Dirk Hohndel
parent 3930cc42a5
commit 0c23e005ea

View file

@ -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");