diff --git a/src/common/config.cpp b/src/common/config.cpp index 491d3c747..7413f6409 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -552,11 +552,22 @@ void load(const std::filesystem::path& path) { fmt::print("Got exception trying to load config file. Exception: {}\n", ex.what()); return; } + if (data.contains("General")) { + + toml::value& table = toml::find(data, "General"); + auto findkey = table.as_table().find("isPS4Pro"); + if (findkey != table.as_table().end()) { + table.as_table().erase(findkey); + data["General"]["isPS4ProEnabled"] = false; + std::ofstream file(path, std::ios::binary); + file << data; + file.close(); + } + const toml::value& general = data.at("General"); - // isNeo = toml::find_or(general, "isPS4Pro", false); - isNeo = toml::find_or(general, "isPS4Pro-temp", false); + isNeo = toml::find_or(general, "isPS4ProEnabled", false); isFullscreen = toml::find_or(general, "Fullscreen", false); playBGM = toml::find_or(general, "playBGM", false); isTrophyPopupDisabled = toml::find_or(general, "isTrophyPopupDisabled", false); @@ -676,8 +687,7 @@ void save(const std::filesystem::path& path) { fmt::print("Saving new configuration file {}\n", fmt::UTF(path.u8string())); } - // data["General"]["isPS4Pro"] = isNeo; - data["General"]["isPS4Pro-temp"] = isNeo; + data["General"]["isPS4ProEnabled"] = isNeo; data["General"]["Fullscreen"] = isFullscreen; data["General"]["isTrophyPopupDisabled"] = isTrophyPopupDisabled; data["General"]["playBGM"] = playBGM; diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index 349c2d17a..2f89c9fd2 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -273,7 +273,8 @@ void SettingsDialog::LoadValuesFromConfig() { ui->separateUpdatesCheckBox->setChecked( toml::find_or(data, "General", "separateUpdateEnabled", false)); ui->showSplashCheckBox->setChecked(toml::find_or(data, "General", "showSplash", false)); - // ui->ps4proCheckBox->setChecked(toml::find_or(data, "General", "isPS4Pro", false)); + // ui->ps4proCheckBox->setChecked(toml::find_or(data, "General", "isPS4ProEnabled", + // false)); ui->logTypeComboBox->setCurrentText( QString::fromStdString(toml::find_or(data, "General", "logType", "async"))); ui->logFilterLineEdit->setText( @@ -554,4 +555,4 @@ void SettingsDialog::ResetInstallFolders() { } Config::setGameInstallDirs(settings_install_dirs_config); } -} +} \ No newline at end of file