From d8e1921b573fb05bebd98a846ee2f6ffa0621b8d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 12 Nov 2020 02:29:21 -0500 Subject: [PATCH] InputCommon: Migrate over to fmt-capable panic alerts Continues the migration over to fmt. --- Source/Core/InputCommon/InputConfig.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Core/InputCommon/InputConfig.cpp b/Source/Core/InputCommon/InputConfig.cpp index 501e75d958..b531e56003 100644 --- a/Source/Core/InputCommon/InputConfig.cpp +++ b/Source/Core/InputCommon/InputConfig.cpp @@ -60,10 +60,12 @@ bool InputConfig::LoadConfig(bool isGC) for (int i = 0; i < 4; i++) { - if (control_section->Exists(type + "Profile" + std::string(num[i]))) + const auto profile_name = fmt::format("{}Profile{}", type, num[i]); + + if (control_section->Exists(profile_name)) { std::string profile_setting; - if (control_section->Get(type + "Profile" + std::string(num[i]), &profile_setting)) + if (control_section->Get(profile_name, &profile_setting)) { auto profiles = InputProfile::GetProfilesFromSetting( profile_setting, File::GetUserPath(D_CONFIG_IDX) + path); @@ -71,7 +73,7 @@ bool InputConfig::LoadConfig(bool isGC) if (profiles.empty()) { // TODO: PanicAlert shouldn't be used for this. - PanicAlertT("No profiles found for game setting '%s'", profile_setting.c_str()); + PanicAlertFmtT("No profiles found for game setting '{}'", profile_setting); continue; }