DolphinQt/Config/ARCodeWidget: Deduplicate ini path

We can just store this to a const local and use it to avoid doing the
same work twice.
This commit is contained in:
Lioncash 2019-07-31 08:35:57 -04:00
parent c70da390a7
commit 0d406f2bdc
1 changed files with 6 additions and 4 deletions

View File

@ -168,11 +168,13 @@ void ARCodeWidget::UpdateList()
void ARCodeWidget::SaveCodes() void ARCodeWidget::SaveCodes()
{ {
IniFile game_ini_local; const auto ini_path =
game_ini_local.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + m_game_id + ".ini"); std::string(File::GetUserPath(D_GAMESETTINGS_IDX)).append(m_game_id).append(".ini");
ActionReplay::SaveCodes(&game_ini_local, m_ar_codes);
game_ini_local.Save(File::GetUserPath(D_GAMESETTINGS_IDX) + m_game_id + ".ini"); IniFile game_ini_local;
game_ini_local.Load(ini_path);
ActionReplay::SaveCodes(&game_ini_local, m_ar_codes);
game_ini_local.Save(ini_path);
} }
void ARCodeWidget::AddCode(ActionReplay::ARCode code) void ARCodeWidget::AddCode(ActionReplay::ARCode code)