MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / bootstrapModuleManager

Function bootstrapModuleManager

app/src/main.cpp:74–96  ·  view source on GitHub ↗

* @brief Constructs and initializes the ModuleManager, exposing CLI flags to QML. */

Source from the content-addressed store, hash-verified

72 * @brief Constructs and initializes the ModuleManager, exposing CLI flags to QML.
73 */
74static 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.

Callers 1

mainFunction · 0.85

Calls 10

shortcutIdentityHashFunction · 0.85
setHeadlessMethod · 0.80
configureUpdaterMethod · 0.80
registerQmlTypesMethod · 0.80
isEmptyMethod · 0.80
engineMethod · 0.80
fullscreenMethod · 0.80
hideToolbarMethod · 0.80
runtimeModeMethod · 0.80

Tested by

no test coverage detected