DolphinQt/Config/GeckoCodeWidget: Deduplicate ini path

We can store this to a local variable to avoid duplicating the same
string creation twice.
This commit is contained in:
Lioncash 2019-07-31 09:11:44 -04:00
parent a07d19a2fd
commit 255d2ff2d2
1 changed files with 5 additions and 4 deletions

View File

@ -229,12 +229,13 @@ void GeckoCodeWidget::RemoveCode()
void GeckoCodeWidget::SaveCodes() void GeckoCodeWidget::SaveCodes()
{ {
const auto ini_path =
std::string(File::GetUserPath(D_GAMESETTINGS_IDX)).append(m_game_id).append(".ini");
IniFile game_ini_local; IniFile game_ini_local;
game_ini_local.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + m_game_id + ".ini"); game_ini_local.Load(ini_path);
Gecko::SaveCodes(game_ini_local, m_gecko_codes); Gecko::SaveCodes(game_ini_local, m_gecko_codes);
game_ini_local.Save(ini_path);
game_ini_local.Save(File::GetUserPath(D_GAMESETTINGS_IDX) + m_game_id + ".ini");
} }
void GeckoCodeWidget::OnContextMenuRequested() void GeckoCodeWidget::OnContextMenuRequested()