diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index a81745c04..365b6b0ed 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -56,6 +56,8 @@ Log_SetChannel(CommonHostInterface); +static std::string s_settings_filename; + CommonHostInterface::CommonHostInterface() = default; CommonHostInterface::~CommonHostInterface() = default; @@ -367,7 +369,7 @@ bool CommonHostInterface::ParseCommandLineParameters(int argc, char* argv[], } else if (CHECK_ARG_PARAM("-settings")) { - m_settings_filename = argv[++i]; + s_settings_filename = argv[++i]; continue; } else if (CHECK_ARG("--")) @@ -2367,18 +2369,13 @@ bool CommonHostInterface::SaveInputProfile(const char* profile_path) std::string CommonHostInterface::GetSettingsFileName() const { - if (!m_settings_filename.empty()) - { - if (!FileSystem::FileExists(m_settings_filename.c_str())) - { - Log_ErrorPrintf("Could not find settings file %s, using default", m_settings_filename.c_str()); - } - else - { - return GetUserDirectoryRelativePath(m_settings_filename.c_str()); - } - } - return GetUserDirectoryRelativePath("settings.ini"); + std::string filename; + if (!s_settings_filename.empty()) + filename = s_settings_filename; + else + filename = GetUserDirectoryRelativePath("settings.ini"); + + return filename; } std::string CommonHostInterface::GetGameSaveStateFileName(const char* game_code, s32 slot) const diff --git a/src/frontend-common/common_host_interface.h b/src/frontend-common/common_host_interface.h index 6fb1dcc82..cd835188a 100644 --- a/src/frontend-common/common_host_interface.h +++ b/src/frontend-common/common_host_interface.h @@ -418,7 +418,6 @@ protected: void DoFrameStep(); void DoToggleCheats(); - std::string m_settings_filename; std::unique_ptr m_settings_interface; std::recursive_mutex m_settings_mutex;