aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/mapwidget.cpp4
-rw-r--r--subsurface-desktop-helper.cpp1
-rw-r--r--subsurface-helper.cpp4
3 files changed, 3 insertions, 6 deletions
diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp
index 6d9cd867d..917b1b2c7 100644
--- a/desktop-widgets/mapwidget.cpp
+++ b/desktop-widgets/mapwidget.cpp
@@ -23,10 +23,6 @@ MapWidget *MapWidget::m_instance = NULL;
MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent)
{
- qmlRegisterType<MapWidgetHelper>("org.subsurfacedivelog.mobile", 1, 0, "MapWidgetHelper");
- qmlRegisterType<MapLocationModel>("org.subsurfacedivelog.mobile", 1, 0, "MapLocationModel");
- qmlRegisterType<MapLocation>("org.subsurfacedivelog.mobile", 1, 0, "MapLocation");
-
m_rootItem = Q_NULLPTR;
m_mapHelper = Q_NULLPTR;
setResizeMode(QQuickWidget::SizeRootObjectToView);
diff --git a/subsurface-desktop-helper.cpp b/subsurface-desktop-helper.cpp
index d633c93ab..da3c8d273 100644
--- a/subsurface-desktop-helper.cpp
+++ b/subsurface-desktop-helper.cpp
@@ -25,6 +25,7 @@ void init_ui()
void run_ui()
{
+ register_qml_types();
MainWindow::instance()->show();
qApp->exec();
}
diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp
index 161cdff76..6a2383f08 100644
--- a/subsurface-helper.cpp
+++ b/subsurface-helper.cpp
@@ -13,9 +13,9 @@
#include "profile-widget/qmlprofile.h"
#include "core/downloadfromdcthread.h"
#include "qt-models/diveimportedmodel.h"
+#endif
#include "map-widget/qmlmapwidgethelper.h"
#include "qt-models/maplocationmodel.h"
-#endif
void register_qml_types()
{
@@ -43,6 +43,7 @@ void register_qml_types()
rc = qmlRegisterType<DiveImportedModel>("org.subsurfacedivelog.mobile", 1, 0, "DCImportModel");
if (rc < 0)
qDebug() << "ERROR: Cannot register DCImportModel, QML will not work!!";
+#endif
rc = qmlRegisterType<MapWidgetHelper>("org.subsurfacedivelog.mobile", 1, 0, "MapWidgetHelper");
if (rc < 0)
@@ -53,5 +54,4 @@ void register_qml_types()
rc = qmlRegisterType<MapLocation>("org.subsurfacedivelog.mobile", 1, 0, "MapLocation");
if (rc < 0)
qDebug() << "ERROR: Cannot register MapLocation, QML will not work!!";
-#endif
}