| 18 | #include <QVariant> |
| 19 | |
| 20 | int main(int argc, char **argv) |
| 21 | { |
| 22 | mitk::BaseApplication app(argc, argv); |
| 23 | app.setApplicationName("BlueBerryExampleLauncher"); |
| 24 | app.setOrganizationName("DKFZ"); |
| 25 | app.initializeQt(); |
| 26 | |
| 27 | BlueBerryExampleLauncherDialog demoDialog; |
| 28 | QString selectedConfiguration = demoDialog.getDemoConfiguration(); |
| 29 | |
| 30 | if (selectedConfiguration.isEmpty()) |
| 31 | return EXIT_SUCCESS; |
| 32 | |
| 33 | app.setProvisioningFilePath(selectedConfiguration); |
| 34 | |
| 35 | // We create the application id relying on a convention: |
| 36 | // org.mitk.example.<configuration-name> |
| 37 | QString appId = "org.mitk.example."; |
| 38 | QStringList appIdTokens = QFileInfo(selectedConfiguration).baseName().toLower().split('_', Qt::SkipEmptyParts); |
| 39 | appId += appIdTokens.size() > 1 ? appIdTokens.at(1) : appIdTokens.at(0); |
| 40 | |
| 41 | // Special cases |
| 42 | if (appId == "org.mitk.example.exampleplugins") |
| 43 | { |
| 44 | appId = "org.mitk.qt.extapplication"; |
| 45 | } |
| 46 | |
| 47 | app.setProperty(mitk::BaseApplication::PROP_APPLICATION, appId); |
| 48 | |
| 49 | return app.run(); |
| 50 | } |
nothing calls this directly
no test coverage detected