summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-06-16 01:12:43 -0400
committerLioncash <mathew1800@gmail.com>2014-06-16 01:31:23 -0400
commitf05d3f6e5d6da8be530c0cd4ffaaec0382240ec5 (patch)
treec598524e0e7b77b3345bc4a8158ceb9421a18e32 /Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp
parent7416b9cdb474f2b4b6808688fb23d335a623dd30 (diff)
Use only section-based ini reading.
Diffstat (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp')
-rw-r--r--Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp
index 1236dd84fe..41abb27300 100644
--- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp
+++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp
@@ -62,14 +62,15 @@ void CCodeWindow::Load()
// The font to override DebuggerFont with
std::string fontDesc;
- ini.Get("General", "DebuggerFont", &fontDesc);
+
+ IniFile::Section* general = ini.GetOrCreateSection("General");
+ general->Get("DebuggerFont", &fontDesc);
+ general->Get("AutomaticStart", &bAutomaticStart, false);
+ general->Get("BootToPause", &bBootToPause, true);
+
if (!fontDesc.empty())
DebuggerFont.SetNativeFontInfoUserDesc(StrToWxStr(fontDesc));
- // Boot to pause or not
- ini.Get("General", "AutomaticStart", &bAutomaticStart, false);
- ini.Get("General", "BootToPause", &bBootToPause, true);
-
const char* SettingName[] = {
"Log",
"LogConfig",
@@ -85,19 +86,19 @@ void CCodeWindow::Load()
// Decide what windows to show
for (int i = 0; i <= IDM_VIDEOWINDOW - IDM_LOGWINDOW; i++)
- ini.Get("ShowOnStart", SettingName[i], &bShowOnStart[i], false);
+ ini.GetOrCreateSection("ShowOnStart")->Get(SettingName[i], &bShowOnStart[i], false);
// Get notebook affiliation
- std::string _Section = "P - " +
+ std::string section = "P - " +
((Parent->ActivePerspective < Parent->Perspectives.size())
? Parent->Perspectives[Parent->ActivePerspective].Name : "Perspective 1");
for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++)
- ini.Get(_Section, SettingName[i], &iNbAffiliation[i], 0);
+ ini.GetOrCreateSection(section)->Get(SettingName[i], &iNbAffiliation[i], 0);
// Get floating setting
for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++)
- ini.Get("Float", SettingName[i], &Parent->bFloatWindow[i], false);
+ ini.GetOrCreateSection("Float")->Get(SettingName[i], &Parent->bFloatWindow[i], false);
}
void CCodeWindow::Save()
@@ -105,11 +106,10 @@ void CCodeWindow::Save()
IniFile ini;
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
- ini.Set("General", "DebuggerFont", WxStrToStr(DebuggerFont.GetNativeFontInfoUserDesc()));
-
- // Boot to pause or not
- ini.Set("General", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART));
- ini.Set("General", "BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE));
+ IniFile::Section* general = ini.GetOrCreateSection("General");
+ general->Set("DebuggerFont", WxStrToStr(DebuggerFont.GetNativeFontInfoUserDesc()));
+ general->Set("AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART));
+ general->Set("BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE));
const char* SettingName[] = {
"Log",
@@ -126,16 +126,16 @@ void CCodeWindow::Save()
// Save windows settings
for (int i = IDM_LOGWINDOW; i <= IDM_VIDEOWINDOW; i++)
- ini.Set("ShowOnStart", SettingName[i - IDM_LOGWINDOW], GetMenuBar()->IsChecked(i));
+ ini.GetOrCreateSection("ShowOnStart")->Set(SettingName[i - IDM_LOGWINDOW], GetMenuBar()->IsChecked(i));
// Save notebook affiliations
- std::string _Section = "P - " + Parent->Perspectives[Parent->ActivePerspective].Name;
+ std::string section = "P - " + Parent->Perspectives[Parent->ActivePerspective].Name;
for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++)
- ini.Set(_Section, SettingName[i], iNbAffiliation[i]);
+ ini.GetOrCreateSection(section)->Set(SettingName[i], iNbAffiliation[i]);
// Save floating setting
for (int i = IDM_LOGWINDOW_PARENT; i <= IDM_CODEWINDOW_PARENT; i++)
- ini.Set("Float", SettingName[i - IDM_LOGWINDOW_PARENT], !!FindWindowById(i));
+ ini.GetOrCreateSection("Float")->Set(SettingName[i - IDM_LOGWINDOW_PARENT], !!FindWindowById(i));
ini.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
}