mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-03-01 00:45:39 +00:00
INISettingsInterface: Make constructor parameter a std::string
This commit is contained in:
parent
45d7294c3c
commit
70ccdcfc30
src
duckstation-sdl
frontend-common
|
@ -265,7 +265,7 @@ void SDLHostInterface::RunLater(std::function<void()> callback)
|
||||||
|
|
||||||
void SDLHostInterface::SaveSettings()
|
void SDLHostInterface::SaveSettings()
|
||||||
{
|
{
|
||||||
INISettingsInterface si(GetSettingsFileName().c_str());
|
INISettingsInterface si(GetSettingsFileName());
|
||||||
m_settings_copy.Save(si);
|
m_settings_copy.Save(si);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ std::unique_ptr<SDLHostInterface> SDLHostInterface::Create()
|
||||||
std::unique_ptr<SDLHostInterface> intf = std::make_unique<SDLHostInterface>();
|
std::unique_ptr<SDLHostInterface> intf = std::make_unique<SDLHostInterface>();
|
||||||
|
|
||||||
// Settings need to be loaded prior to creating the window for OpenGL bits.
|
// Settings need to be loaded prior to creating the window for OpenGL bits.
|
||||||
INISettingsInterface si(intf->GetSettingsFileName().c_str());
|
INISettingsInterface si(intf->GetSettingsFileName());
|
||||||
intf->m_settings_copy.Load(si);
|
intf->m_settings_copy.Load(si);
|
||||||
intf->m_settings = intf->m_settings_copy;
|
intf->m_settings = intf->m_settings_copy;
|
||||||
intf->m_fullscreen = intf->m_settings_copy.start_fullscreen;
|
intf->m_fullscreen = intf->m_settings_copy.start_fullscreen;
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
Log_SetChannel(INISettingsInterface);
|
Log_SetChannel(INISettingsInterface);
|
||||||
|
|
||||||
INISettingsInterface::INISettingsInterface(const char* filename) : m_filename(filename), m_ini(true, true)
|
INISettingsInterface::INISettingsInterface(std::string filename) : m_filename(std::move(filename)), m_ini(true, true)
|
||||||
{
|
{
|
||||||
SI_Error err = m_ini.LoadFile(filename);
|
SI_Error err = m_ini.LoadFile(m_filename.c_str());
|
||||||
if (err != SI_OK)
|
if (err != SI_OK)
|
||||||
Log_WarningPrintf("Settings could not be loaded from '%s', defaults will be used.", filename);
|
Log_WarningPrintf("Settings could not be loaded from '%s', defaults will be used.", m_filename.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
INISettingsInterface::~INISettingsInterface()
|
INISettingsInterface::~INISettingsInterface()
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
class INISettingsInterface : public SettingsInterface
|
class INISettingsInterface : public SettingsInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
INISettingsInterface(const char* filename);
|
INISettingsInterface(std::string filename);
|
||||||
~INISettingsInterface();
|
~INISettingsInterface();
|
||||||
|
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
Loading…
Reference in a new issue