diff options
| author | Matthew Parlane <parlane@gmail.com> | 2014-02-08 18:50:37 +1300 |
|---|---|---|
| committer | Matthew Parlane <parlane@gmail.com> | 2014-02-13 17:06:30 +1300 |
| commit | 3fe05e0a9f6908c1cf9a3caad6bff1d8decf04a3 (patch) | |
| tree | 129603623669b47f44d89e83437e4f36d194c06e /Source/Core/InputCommon/InputConfig.cpp | |
| parent | 079b1ba93deb8f3585f9211cfd1f73ccf16ae2a7 (diff) | |
Fix IniFile to use string& instead of char*
Also removes .c_str() usages where found.
Diffstat (limited to 'Source/Core/InputCommon/InputConfig.cpp')
| -rw-r--r-- | Source/Core/InputCommon/InputConfig.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/Core/InputCommon/InputConfig.cpp b/Source/Core/InputCommon/InputConfig.cpp index 41f18c8403..e3e6d318af 100644 --- a/Source/Core/InputCommon/InputConfig.cpp +++ b/Source/Core/InputCommon/InputConfig.cpp @@ -40,15 +40,17 @@ bool InputPlugin::LoadConfig(bool isGC) game_ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + SConfig::GetInstance().m_LocalCoreStartupParameter.GetUniqueID() + ".ini", true); for (int i = 0; i < 4; i++) { - if (game_ini.Exists("Controls", (type + "Profile" + num[i]).c_str())) + if (game_ini.Exists("Controls", type + "Profile" + num[i])) { - game_ini.Get("Controls", (type + "Profile" + num[i]).c_str(), &profile[i]); - if (File::Exists(File::GetUserPath(D_CONFIG_IDX) + path + profile[i] + ".ini")) - useProfile[i] = true; - else + if (game_ini.Get("Controls", type + "Profile" + num[i], &profile[i])) { - // TODO: Having a PanicAlert for this is dumb. - PanicAlertT("Selected controller profile does not exist"); + if (File::Exists(File::GetUserPath(D_CONFIG_IDX) + path + profile[i] + ".ini")) + useProfile[i] = true; + else + { + // TODO: Having a PanicAlert for this is dumb. + PanicAlertT("Selected controller profile does not exist"); + } } } } @@ -68,7 +70,7 @@ bool InputPlugin::LoadConfig(bool isGC) } else { - pad->LoadConfig(inifile.GetOrCreateSection(pad->GetName().c_str())); + pad->LoadConfig(inifile.GetOrCreateSection(pad->GetName())); } // Update refs @@ -95,7 +97,7 @@ void InputPlugin::SaveConfig() inifile.Load(ini_filename); for (ControllerEmu* pad : controllers) - pad->SaveConfig(inifile.GetOrCreateSection(pad->GetName().c_str())); + pad->SaveConfig(inifile.GetOrCreateSection(pad->GetName())); inifile.Save(ini_filename); } |
