summaryrefslogtreecommitdiffstats
path: root/subsurface-mobile-helper.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-11 11:34:33 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-12 08:08:00 -0700
commit8cc0b6dbc14d26cd0fff14b7f0368b33433a0191 (patch)
tree9186fb9f7088f93ae0d7e0550e879a7c15a3955c /subsurface-mobile-helper.cpp
parenta56a7c51f656f9cd7fbcf00b2d0c19d0e74ec701 (diff)
downloadsubsurface-8cc0b6dbc14d26cd0fff14b7f0368b33433a0191.tar.gz
ssrf: add shared helper file
add subsurface-helper.cpp to share functions between mobile and desktop move mobile qml registrations to a shared function (avoiding differences in registrations) Target is to replace current subsurface-desktop-main + subsurface-desktop-helper and subsurface-mobile-main + subsurface-mobile-helper with subsurface-*-main + subsurface-helper Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'subsurface-mobile-helper.cpp')
-rw-r--r--subsurface-mobile-helper.cpp39
1 files changed, 1 insertions, 38 deletions
diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp
index 5d7fe6c35..fc0431ef9 100644
--- a/subsurface-mobile-helper.cpp
+++ b/subsurface-mobile-helper.cpp
@@ -17,16 +17,8 @@
#include <QQmlContext>
#include <QSortFilterProxyModel>
#include "mobile-widgets/qmlmanager.h"
-#include "mobile-widgets/qmlprefs.h"
-#include "qt-models/divelistmodel.h"
#include "qt-models/gpslistmodel.h"
-#include "profile-widget/qmlprofile.h"
-#include "core/downloadfromdcthread.h"
-#include "core/connectionlistmodel.h"
-#include "qt-models/diveimportedmodel.h"
#include "qt-models/messagehandlermodel.h"
-#include "map-widget/qmlmapwidgethelper.h"
-#include "qt-models/maplocationmodel.h"
#include "core/settings/qPref.h"
#include "mobile-widgets/qml/kirigami/src/kirigamiplugin.h"
@@ -55,37 +47,8 @@ void init_ui()
void run_ui()
{
- int rc;
LOG_STP("run_ui starting");
- rc = qmlRegisterType<qPref>("org.subsurfacedivelog.mobile", 1, 0, "SsrfPrefs");
- if (rc < 0)
- qDebug() << "ERROR: Cannot register Prefs (class qPref), QML will not work!!";
- rc = qmlRegisterType<QMLManager>("org.subsurfacedivelog.mobile", 1, 0, "QMLManager");
- if (rc < 0)
- qDebug() << "ERROR: Cannot register QMLManager, QML will not work!!";
- rc = qmlRegisterType<QMLPrefs>("org.subsurfacedivelog.mobile", 1, 0, "QMLPrefs");
- if (rc < 0)
- qDebug() << "ERROR: Cannot register QMLPrefs, QML will not work!!";
- rc = qmlRegisterType<QMLProfile>("org.subsurfacedivelog.mobile", 1, 0, "QMLProfile");
- if (rc < 0)
- qDebug() << "ERROR: Cannot register QMLProfile, QML will not work!!";
-
- rc = qmlRegisterType<DownloadThread>("org.subsurfacedivelog.mobile", 1, 0, "DCDownloadThread");
- if (rc < 0)
- qDebug() << "ERROR: Cannot register DCDownloadThread, QML will not work!!";
- rc = qmlRegisterType<DiveImportedModel>("org.subsurfacedivelog.mobile", 1, 0, "DCImportModel");
- if (rc < 0)
- qDebug() << "ERROR: Cannot register DCImportModel, QML will not work!!";
-
- rc = qmlRegisterType<MapWidgetHelper>("org.subsurfacedivelog.mobile", 1, 0, "MapWidgetHelper");
- if (rc < 0)
- qDebug() << "ERROR: Cannot register MapWidgetHelper, QML will not work!!";
- rc = qmlRegisterType<MapLocationModel>("org.subsurfacedivelog.mobile", 1, 0, "MapLocationModel");
- if (rc < 0)
- qDebug() << "ERROR: Cannot register MapLocationModel, QML will not work!!";
- rc = qmlRegisterType<MapLocation>("org.subsurfacedivelog.mobile", 1, 0, "MapLocation");
- if (rc < 0)
- qDebug() << "ERROR: Cannot register MapLocation, QML will not work!!";
+ register_qml_types();
QQmlApplicationEngine engine;
LOG_STP("run_ui qml engine started");