diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp index b87eef027..5d7fe6c35 100644 --- a/subsurface-mobile-helper.cpp +++ b/subsurface-mobile-helper.cpp @@ -55,18 +55,37 @@ void init_ui() void run_ui() { + int rc; LOG_STP("run_ui starting"); - qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "SsrfPrefs"); - qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "QMLManager"); - qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "QMLPrefs"); - qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "QMLProfile"); + rc = qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "SsrfPrefs"); + if (rc < 0) + qDebug() << "ERROR: Cannot register Prefs (class qPref), QML will not work!!"; + rc = qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "QMLManager"); + if (rc < 0) + qDebug() << "ERROR: Cannot register QMLManager, QML will not work!!"; + rc = qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "QMLPrefs"); + if (rc < 0) + qDebug() << "ERROR: Cannot register QMLPrefs, QML will not work!!"; + rc = qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "QMLProfile"); + if (rc < 0) + qDebug() << "ERROR: Cannot register QMLProfile, QML will not work!!"; - qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "DCDownloadThread"); - qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "DCImportModel"); + rc = qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "DCDownloadThread"); + if (rc < 0) + qDebug() << "ERROR: Cannot register DCDownloadThread, QML will not work!!"; + rc = qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "DCImportModel"); + if (rc < 0) + qDebug() << "ERROR: Cannot register DCImportModel, QML will not work!!"; - qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "MapWidgetHelper"); - qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "MapLocationModel"); - qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "MapLocation"); + rc = qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "MapWidgetHelper"); + if (rc < 0) + qDebug() << "ERROR: Cannot register MapWidgetHelper, QML will not work!!"; + rc = qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "MapLocationModel"); + if (rc < 0) + qDebug() << "ERROR: Cannot register MapLocationModel, QML will not work!!"; + rc = qmlRegisterType("org.subsurfacedivelog.mobile", 1, 0, "MapLocation"); + if (rc < 0) + qDebug() << "ERROR: Cannot register MapLocation, QML will not work!!"; QQmlApplicationEngine engine; LOG_STP("run_ui qml engine started");