* @brief Initializes all application modules and loads the root QML file. */
| 559 | * @brief Initializes all application modules and loads the root QML file. |
| 560 | */ |
| 561 | void Misc::ModuleManager::initializeQmlInterface() |
| 562 | { |
| 563 | #ifdef ENABLE_GRPC |
| 564 | (void)API::GRPC::GRPCServer::instance(); |
| 565 | const bool grpcAvailable = true; |
| 566 | #else |
| 567 | const bool grpcAvailable = false; |
| 568 | #endif |
| 569 | |
| 570 | Misc::TimerEvents::instance().startTimers(); |
| 571 | |
| 572 | connect(&Misc::Translator::instance(), |
| 573 | &Misc::Translator::languageChanged, |
| 574 | &m_engine, |
| 575 | &QQmlApplicationEngine::retranslate); |
| 576 | |
| 577 | setupCrossModuleConnections(); |
| 578 | |
| 579 | qInstallMessageHandler(MessageHandler); |
| 580 | qAddPostRoutine([]() { qInstallMessageHandler(nullptr); }); |
| 581 | |
| 582 | Platform::AppPlatform::registerIngestThreadWithMmcss(); |
| 583 | |
| 584 | const auto c = m_engine.rootContext(); |
| 585 | registerCoreContextProperties(c); |
| 586 | #ifdef BUILD_COMMERCIAL |
| 587 | registerCommercialContextProperties(c); |
| 588 | #endif |
| 589 | registerAppMetadataProperties(c, grpcAvailable); |
| 590 | |
| 591 | if (!m_headless) |
| 592 | registerImageProvidersAndLoadQml(); |
| 593 | |
| 594 | #ifdef BUILD_COMMERCIAL |
| 595 | auto& lemonSqueezy = Licensing::LemonSqueezy::instance(); |
| 596 | if (!lemonSqueezy.licensingData().isEmpty()) |
| 597 | QMetaObject::invokeMethod(&lemonSqueezy, &Licensing::LemonSqueezy::validate); |
| 598 | #endif |
| 599 | } |
| 600 | |
| 601 | /** |
| 602 | * @brief Wires inter-module signals and runs each module's setupExternalConnections. |
no test coverage detected