Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Create blank ini file before editing it, if it doesn't already exists…
…. This prevents the editor from prompting to create it.
  • Loading branch information
RachelBryk committed Sep 15, 2013
1 parent 6dc16a5 commit 550c855
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/Core/DolphinWX/Src/ISOProperties.cpp
Expand Up @@ -1077,8 +1077,8 @@ bool CISOProperties::SaveGameConfig()
bool success = GameIniLocal.Save(GameIniFileLocal.c_str());

// If the resulting file is empty, delete it. Kind of a hack, but meh.
if (success && File::GetSize(GameIniFileLocal) == 0)
File::Delete(GameIniFileLocal);
//if (success && File::GetSize(GameIniFileLocal) == 0)
// File::Delete(GameIniFileLocal);

return success;
}
Expand Down Expand Up @@ -1119,6 +1119,12 @@ void CISOProperties::LaunchExternalEditor(const std::string& filename)
void CISOProperties::OnEditConfig(wxCommandEvent& WXUNUSED (event))
{
SaveGameConfig();
// Create blank file to prevent editor from prompting to create it.
if (!File::Exists(GameIniFileLocal))
{
std::fstream blankFile(GameIniFileLocal);
blankFile.close();
}
LaunchExternalEditor(GameIniFileLocal);
GameIniLocal.Load(GameIniFileLocal);
LoadGameConfig();
Expand Down

0 comments on commit 550c855

Please sign in to comment.