From 550c855ae6ccf48b85cac6c5032d24cac8e5deac Mon Sep 17 00:00:00 2001 From: Rachel Bryk Date: Sat, 14 Sep 2013 20:27:54 -0400 Subject: [PATCH] Create blank ini file before editing it, if it doesn't already exists. This prevents the editor from prompting to create it. --- Source/Core/DolphinWX/Src/ISOProperties.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index a158c37278..f3f675779e 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -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; } @@ -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();