#include #include #include #include #include #include #include #include Q_DECLARE_METATYPE(CURLcode) Q_DECLARE_METATYPE(Bytestream) Q_DECLARE_METATYPE(PrintParameters) template static QObject* singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) T *inst = T::instance(); return inst; } int main(int argc, char *argv[]) { qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); // Turn on/off logging according to setting QLoggingCategory::defaultCategory()->setEnabled(QtMsgType::QtDebugMsg, Settings::instance()->debugLog()); QGuiApplication* app = SailfishApp::application(argc, argv); app->setOrganizationName(QStringLiteral("net.attah")); app->setApplicationName(QStringLiteral("seaprint")); app->setApplicationVersion(QStringLiteral(SEAPRINT_VERSION)); qmlRegisterSingletonType("seaprint.ippdiscovery", 1, 0, "IppDiscovery", singletontype_provider); qmlRegisterSingletonType("seaprint.mimer", 1, 0, "Mimer", singletontype_provider); qmlRegisterSingletonType("seaprint.convertchecker", 1, 0, "ConvertChecker", singletontype_provider); qmlRegisterSingletonType("seaprint.settings", 1, 0, "SeaPrintSettings", singletontype_provider); qmlRegisterType("seaprint.ippprinter", 1, 0, "IppPrinter"); qmlRegisterType("seaprint.imageitem", 1, 0, "ImageItem"); qmlRegisterUncreatableType("seaprint.ippmsg", 1, 0, "IppMsg", "Only used to supply an enum type"); QQuickView* view = SailfishApp::createView(); view->engine()->addImportPath(SailfishApp::pathTo("qml/pages").toString()); view->setSource(SailfishApp::pathToMainQml()); view->show(); return app->exec(); }