From 32eeb5130583c5f861d5ab8c9c77ecab2b34ae0e Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Wed, 12 Sep 2018 12:22:11 +0200 Subject: [PATCH] Ssrf: correct mapWidget registration for desktop version Registration was after the mainwindow was created. Move registration back to before creation. Signed-off-by: Jan Iversen --- subsurface-helper.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp index f261f3e1f..980ddd433 100644 --- a/subsurface-helper.cpp +++ b/subsurface-helper.cpp @@ -31,12 +31,16 @@ #ifndef SUBSURFACE_TEST_DATA QObject *qqWindowObject = NULL; +// Forward declaration +static void register_qml_types(QQmlEngine *); static void register_meta_types(); + void init_ui() { init_qt_late(); register_meta_types(); #ifndef SUBSURFACE_MOBILE + register_qml_types(NULL); PluginManager::instance().loadPlugins(); MainWindow *window = new MainWindow(); @@ -59,8 +63,6 @@ double get_screen_dpi() return mydesk->physicalDpiX(); } -// Forward declaration -static void register_qml_types(QQmlEngine *); void run_ui() { @@ -138,7 +140,6 @@ void run_ui() qml_window->show(); LOG_STP("run_ui running exec"); #else - register_qml_types(NULL); MainWindow::instance()->show(); #endif // SUBSURFACE_MOBILE qApp->exec();