#include #include #include #include #include #include #include #define PPM2PWG_MAIN ppm2pwg_main #include 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[]) { if(argc >= 1 && QString("ppm2pwg") == argv[1]) { return ppm2pwg_main(argc-1, &(argv[1])); } QGuiApplication* app = SailfishApp::application(argc, argv); 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); qmlRegisterType("seaprint.ippprinter", 1, 0, "IppPrinter"); QQuickView* view = SailfishApp::createView(); view->engine()->addImportPath(SailfishApp::pathTo("qml/pages").toString()); view->engine()->addImageProvider(QLatin1String("ippdiscovery"), IppDiscovery::instance()); view->setSource(SailfishApp::pathToMainQml()); view->show(); return app->exec(); }