mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
emu_settings: fix faulty custom config file creation
This commit is contained in:
parent
4c42043940
commit
eeb4d4d4de
2 changed files with 11 additions and 3 deletions
|
@ -174,6 +174,8 @@ Render_Creator::Render_Creator()
|
|||
|
||||
emu_settings::emu_settings(const std::string& path) : QObject()
|
||||
{
|
||||
m_path = path;
|
||||
|
||||
// Create config path if necessary
|
||||
fs::create_path(fs::get_config_dir() + path);
|
||||
|
||||
|
@ -185,9 +187,9 @@ emu_settings::emu_settings(const std::string& path) : QObject()
|
|||
currentSettings += YAML::Load(config.to_string());
|
||||
|
||||
// Add game config
|
||||
if (!path.empty())
|
||||
if (!path.empty() && fs::is_file(fs::get_config_dir() + path + "/config.yml"))
|
||||
{
|
||||
config = fs::file(fs::get_config_dir() + path + "/config.yml", fs::read + fs::write + fs::create);
|
||||
config = fs::file(fs::get_config_dir() + path + "/config.yml", fs::read + fs::write);
|
||||
currentSettings += YAML::Load(config.to_string());
|
||||
}
|
||||
}
|
||||
|
@ -200,7 +202,12 @@ void emu_settings::SaveSettings()
|
|||
{
|
||||
YAML::Emitter out;
|
||||
emitData(out, currentSettings);
|
||||
|
||||
|
||||
if (!m_path.empty())
|
||||
{
|
||||
config = fs::file(fs::get_config_dir() + m_path + "/config.yml", fs::read + fs::write + fs::create);
|
||||
}
|
||||
|
||||
// Save config
|
||||
config.seek(0);
|
||||
config.trunc(0);
|
||||
|
|
|
@ -205,4 +205,5 @@ private:
|
|||
|
||||
YAML::Node currentSettings; // The current settings as a YAML node.
|
||||
fs::file config; //! File to read/write the config settings.
|
||||
std::string m_path;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue