From 56f09d3b91479deb0f3ae3c7ce623c7a4724e087 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Wed, 27 Feb 2013 22:37:38 -0600 Subject: Attempt to be consistent with conversions between std::string and wxString. --- .../DolphinWX/Src/Debugger/CodeWindowFunctions.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp index 706b398dce..a11783c010 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp @@ -25,6 +25,7 @@ #include "DebuggerUIUtil.h" +#include "../WxUtils.h" #include "RegisterWindow.h" #include "BreakpointWindow.h" #include "MemoryWindow.h" @@ -65,7 +66,7 @@ void CCodeWindow::Load() std::string fontDesc; ini.Get("General", "DebuggerFont", &fontDesc); if (!fontDesc.empty()) - DebuggerFont.SetNativeFontInfoUserDesc(wxString::FromAscii(fontDesc.c_str())); + DebuggerFont.SetNativeFontInfoUserDesc(StrToWxStr(fontDesc.c_str())); // Boot to pause or not ini.Get("General", "AutomaticStart", &bAutomaticStart, false); @@ -107,7 +108,7 @@ void CCodeWindow::Save() ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); ini.Set("General", "DebuggerFont", - std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str())); + WxStrToStr(DebuggerFont.GetNativeFontInfoUserDesc())); // Boot to pause or not ini.Set("General", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART)); @@ -154,7 +155,7 @@ void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar) pSymbolsMenu->Append(IDM_SAVEMAPFILE, _("&Save symbol map")); pSymbolsMenu->AppendSeparator(); pSymbolsMenu->Append(IDM_SAVEMAPFILEWITHCODES, _("Save code"), - wxString::FromAscii("Save the entire disassembled code. This may take a several seconds" + StrToWxStr("Save the entire disassembled code. This may take a several seconds" " and may require between 50 and 100 MB of hard drive space. It will only save code" " that are in the first 4 MB of memory, if you are debugging a game that load .rel" " files with code to memory you may want to increase that to perhaps 8 MB, you can do" @@ -284,7 +285,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { - std::ifstream f(path.mb_str()); + std::ifstream f(WxStrToStr(path)); std::string line; while (std::getline(f, line)) @@ -312,13 +313,13 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) { wxTextEntryDialog input_prefix( this, - wxString::FromAscii("Only export symbols with prefix:\n(Blank for all symbols)"), + StrToWxStr("Only export symbols with prefix:\n(Blank for all symbols)"), wxGetTextFromUserPromptStr, wxEmptyString); if (input_prefix.ShowModal() == wxID_OK) { - std::string prefix(input_prefix.GetValue().mb_str()); + std::string prefix(WxStrToStr(input_prefix.GetValue())); wxString path = wxFileSelector( _T("Save signature as"), wxEmptyString, wxEmptyString, wxEmptyString, @@ -328,8 +329,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) { SignatureDB db; db.Initialize(&g_symbolDB, prefix.c_str()); - std::string filename(path.mb_str()); - db.Save(path.mb_str()); + db.Save(WxStrToStr(path).c_str()); } } } @@ -343,7 +343,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { SignatureDB db; - db.Load(path.mb_str()); + db.Load(WxStrToStr(path).c_str()); db.Apply(&g_symbolDB); } } @@ -366,7 +366,7 @@ void CCodeWindow::NotifyMapLoaded() symbols->Clear(); for (PPCSymbolDB::XFuncMap::iterator iter = g_symbolDB.GetIterator(); iter != g_symbolDB.End(); ++iter) { - int idx = symbols->Append(wxString::FromAscii(iter->second.name.c_str())); + int idx = symbols->Append(StrToWxStr(iter->second.name.c_str())); symbols->SetClientData(idx, (void*)&iter->second); } symbols->Thaw(); -- cgit v1.2.3 From 03ec9a2e088b0818bf02a5bc2ffda4a512cba2b7 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Thu, 28 Feb 2013 02:39:06 -0600 Subject: Kill some unnecessary c_str and use StrToWxStr in a few places that I missed. --- Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp index a11783c010..7ec36131ff 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp @@ -66,7 +66,7 @@ void CCodeWindow::Load() std::string fontDesc; ini.Get("General", "DebuggerFont", &fontDesc); if (!fontDesc.empty()) - DebuggerFont.SetNativeFontInfoUserDesc(StrToWxStr(fontDesc.c_str())); + DebuggerFont.SetNativeFontInfoUserDesc(StrToWxStr(fontDesc)); // Boot to pause or not ini.Get("General", "AutomaticStart", &bAutomaticStart, false); @@ -366,7 +366,7 @@ void CCodeWindow::NotifyMapLoaded() symbols->Clear(); for (PPCSymbolDB::XFuncMap::iterator iter = g_symbolDB.GetIterator(); iter != g_symbolDB.End(); ++iter) { - int idx = symbols->Append(StrToWxStr(iter->second.name.c_str())); + int idx = symbols->Append(StrToWxStr(iter->second.name)); symbols->SetClientData(idx, (void*)&iter->second); } symbols->Thaw(); -- cgit v1.2.3 From 95558cdc6911e6122fec94616e4d6975d2c355fb Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Thu, 28 Feb 2013 03:11:10 -0600 Subject: Buildfix. --- Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp index 7ec36131ff..362e617696 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp @@ -285,7 +285,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { - std::ifstream f(WxStrToStr(path)); + std::ifstream f(WxStrToStr(path).c_str()); std::string line; while (std::getline(f, line)) -- cgit v1.2.3 From dea1e2827d6ce6eb5f6bfe2c64c59a36b3606b02 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Thu, 28 Feb 2013 19:33:39 -0600 Subject: Open std::fstream in a unicode-safe manner. --- Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp index 362e617696..fad0380eca 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp @@ -285,7 +285,8 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { - std::ifstream f(WxStrToStr(path).c_str()); + std::ifstream f; + OpenFStream(f, WxStrToStr(path), std::ios_base::in); std::string line; while (std::getline(f, line)) -- cgit v1.2.3 From e183711d749fefd480ef8091acfd1230ae8c604e Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sat, 2 Mar 2013 20:34:53 -0600 Subject: wxString conversion cleanup. --- Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp index fad0380eca..ef4622d14f 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp @@ -209,7 +209,7 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event) break; } wxString OpenCommand; - OpenCommand = filetype->GetOpenCommand(wxString::From8BitData(filename.c_str())); + OpenCommand = filetype->GetOpenCommand(StrToWxStr(filename)); if(!OpenCommand.IsEmpty()) wxExecute(OpenCommand, wxEXEC_SYNC); } -- cgit v1.2.3