* @brief Constructs and initializes the ModuleManager, exposing CLI flags to QML. */
| 72 | * @brief Constructs and initializes the ModuleManager, exposing CLI flags to QML. |
| 73 | */ |
| 74 | static bool bootstrapModuleManager(Misc::ModuleManager& moduleManager, |
| 75 | const Misc::CLI& cli, |
| 76 | bool headless, |
| 77 | const QString& shortcutPath) |
| 78 | { |
| 79 | moduleManager.setHeadless(headless); |
| 80 | moduleManager.configureUpdater(); |
| 81 | moduleManager.registerQmlTypes(); |
| 82 | |
| 83 | const QString settingsSuffix = |
| 84 | shortcutPath.isEmpty() |
| 85 | ? QString() |
| 86 | : QStringLiteral("_") + Platform::AppPlatform::shortcutIdentityHash(shortcutPath); |
| 87 | |
| 88 | const auto ctx = moduleManager.engine().rootContext(); |
| 89 | ctx->setContextProperty("CLI_START_FULLSCREEN", cli.fullscreen()); |
| 90 | ctx->setContextProperty("CLI_HIDE_TOOLBAR", cli.hideToolbar()); |
| 91 | ctx->setContextProperty("CLI_RUNTIME_MODE", cli.runtimeMode()); |
| 92 | ctx->setContextProperty("CLI_SETTINGS_SUFFIX", settingsSuffix); |
| 93 | |
| 94 | moduleManager.initializeQmlInterface(); |
| 95 | return headless || !moduleManager.engine().rootObjects().isEmpty(); |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * @brief Application entry-point: bootstraps Qt, parses CLI flags, and runs the event loop. |
no test coverage detected