| 394 | } |
| 395 | |
| 396 | ConfigRuntime::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 | |
| 418 | void 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 |
nothing calls this directly
no test coverage detected