MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / onLoad

Method onLoad

Source/Tools/FEXConfig/Main.cpp:429–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427}
428
429void ConfigRuntime::onLoad(const QUrl& Filename) {
430 // TODO: Distinguish between "load" and "overlay".
431 // Currently, the new configuration is overlaid on top of the previous one.
432
433 if (!OpenFile(Filename.toLocalFile().toStdString().c_str())) {
434 // This basically never happens because OpenFile performs no actual syntax checks.
435 // Treat as fatal since the UI state wouldn't be consistent after ignoring the error.
436 QMessageBox err(QMessageBox::Critical, tr("Could not load config file"), tr("Failed to load \"%1\"").arg(Filename.toLocalFile()),
437 QMessageBox::Ok);
438 err.exec();
439 QApplication::exit();
440 return;
441 }
442
443 ConfigModelInst.Reload();
444 RootFSList.Reload();
445 HostLibs.Reload(Filename.toLocalFile().toStdString().c_str());
446
447 QMetaObject::invokeMethod(Window, "refreshUI");
448}
449
450int main(int Argc, char** Argv) {
451 QApplication App(Argc, Argv);

Callers

nothing calls this directly

Calls 3

OpenFileFunction · 0.85
exitFunction · 0.85
ReloadMethod · 0.80

Tested by

no test coverage detected