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

Method ConfigRuntime

Source/Tools/FEXConfig/Main.cpp:396–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396ConfigRuntime::ConfigRuntime(const QString& ConfigFilename) {
397 HostLibs.Reload(ConfigFilename.toStdString().c_str());
398
399 qmlRegisterSingletonInstance<ConfigModel>("FEX.ConfigModel", 1, 0, "ConfigModel", &ConfigModelInst);
400 qmlRegisterSingletonInstance<HostLibsModel>("FEX.HostLibsModel", 1, 0, "HostLibsModel", &HostLibs);
401 qmlRegisterSingletonInstance<RootFSModel>("FEX.RootFSModel", 1, 0, "RootFSModel", &RootFSList);
402 Engine.load(QUrl("qrc:/main.qml"));
403
404 Window = qobject_cast<QQuickWindow*>(Engine.rootObjects().first());
405 if (!ConfigFilename.isEmpty()) {
406 Window->setProperty("configFilename", QUrl::fromLocalFile(ConfigFilename));
407 } else {
408 Window->setProperty("configFilename", QUrl::fromLocalFile(FEXCore::Config::GetConfigFileLocation().c_str()));
409 Window->setProperty("configDirty", true);
410 Window->setProperty("loadedDefaults", true);
411 }
412
413 ConfigRuntime::connect(Window, SIGNAL(selectedConfigFile(const QUrl&)), this, SLOT(onLoad(const QUrl&)));
414 ConfigRuntime::connect(Window, SIGNAL(triggeredSave(const QUrl&)), this, SLOT(onSave(const QUrl&)));
415 ConfigRuntime::connect(&ConfigModelInst, SIGNAL(modelReset()), Window, SLOT(refreshUI()));
416}
417
418void ConfigRuntime::onSave(const QUrl& Filename) {
419 // If no RootFS is selected, assume another Config layer is setting it up and drop it from the local configuration

Callers

nothing calls this directly

Calls 2

GetConfigFileLocationFunction · 0.85
ReloadMethod · 0.80

Tested by

no test coverage detected