MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / run

Method run

src/moapplication.cpp:308–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308int MOApplication::run(MOMultiProcess& multiProcess)
309{
310 // checking command line
311 TimeThis tt("MOApplication::run()");
312
313 // show splash
314 tt.start("MOApplication::doOneRun() splash");
315
316 MOSplash splash(*m_settings, m_instance->directory(), m_instance->gamePlugin());
317
318 tt.start("MOApplication::doOneRun() finishing");
319
320 // start an api check
321 QString apiKey;
322 if (GlobalSettings::nexusApiKey(apiKey)) {
323 m_nexus->getAccessManager()->apiCheck(apiKey);
324 }
325
326 // tutorials
327 log::debug("initializing tutorials");
328 TutorialManager::init(qApp->applicationDirPath() + "/" +
329 QString::fromStdWString(AppConfig::tutorialsPath()) + "/",
330 m_core.get());
331
332 // styling
333 if (!setStyleFile(m_settings->interface().styleName().value_or(""))) {
334 // disable invalid stylesheet
335 m_settings->interface().setStyleName("");
336 }
337
338 int res = 1;
339
340 {
341 tt.start("MOApplication::doOneRun() MainWindow setup");
342 MainWindow mainWindow(*m_settings, *m_core, *m_plugins);
343
344 // the nexus interface can show dialogs, make sure they're parented to the
345 // main window
346 m_nexus->getAccessManager()->setTopLevelWidget(&mainWindow);
347
348 connect(
349 &mainWindow, &MainWindow::styleChanged, this,
350 [this](auto&& file) {
351 setStyleFile(file);
352 },
353 Qt::QueuedConnection);
354
355 log::debug("displaying main window");
356 mainWindow.show();
357 mainWindow.activateWindow();
358 splash.close();
359
360 tt.stop();
361
362 res = exec();
363 mainWindow.close();
364
365 // main window is about to be destroyed

Callers 1

externalMessageMethod · 0.45

Calls 13

initFunction · 0.85
gamePluginMethod · 0.80
apiCheckMethod · 0.80
getAccessManagerMethod · 0.80
styleNameMethod · 0.80
setStyleNameMethod · 0.80
setTopLevelWidgetMethod · 0.80
resetIfNeededMethod · 0.80
startMethod · 0.45
directoryMethod · 0.45
getMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected