From 2db6b16a708a7dedaca15566f6e898a3ee2035f1 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 30 Mar 2020 21:36:11 +0200 Subject: cleanup: move initialization of ThemeInterface The ThemeInterface was initialized and connected to QML in the register_qml_types() function. However, it is not a type. Move the initialization to a place where we create the other global QML objects. Signed-off-by: Berthold Stoeger --- subsurface-helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'subsurface-helper.cpp') diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp index 65a6e9630..96e984520 100644 --- a/subsurface-helper.cpp +++ b/subsurface-helper.cpp @@ -110,6 +110,7 @@ void run_ui() ctxt->setContextProperty("connectionListModel", &connectionListModel); ctxt->setContextProperty("logModel", MessageHandlerModel::self()); + ctxt->setContextProperty("subsurfaceTheme", ThemeInterface::instance()); qmlRegisterUncreatableType("org.subsurfacedivelog.mobile",1,0,"ExportType","Enum is not a type"); @@ -199,7 +200,6 @@ void register_qml_types(QQmlEngine *engine) // Register qml interface classes QMLInterface::setup(ct); - ct->setContextProperty("subsurfaceTheme", ThemeInterface::instance()); } REGISTER_TYPE(QMLManager, "QMLManager"); -- cgit v1.2.3-70-g09d2