From ba54fac9eb74be6f73e20e2de953cf6f355be57f Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Mon, 28 Feb 2011 20:40:15 +0000 Subject: Convert GetUserPath to return a std::string instead of a const char *. This simplifies its usage in most cases. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7265 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../DolphinWX/Src/Debugger/CodeWindowFunctions.cpp | 36 ++++++++++++---------- 1 file changed, 20 insertions(+), 16 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 786475fb29..e0f59f5813 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp @@ -18,16 +18,8 @@ #include "Common.h" #include "CommonPaths.h" -#include -#include -#include -#include -#include -#include -#include #include - -#include "../../DolphinWX/Src/WxUtils.h" +#include #include "Host.h" @@ -165,7 +157,6 @@ void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar) { wxMenu *pSymbolsMenu = new wxMenu; pSymbolsMenu->Append(IDM_CLEARSYMBOLS, _("&Clear symbols")); - // pSymbolsMenu->Append(IDM_CLEANSYMBOLS, _("&Clean symbols (zz)")); pSymbolsMenu->Append(IDM_SCANFUNCTIONS, _("&Generate symbol map")); pSymbolsMenu->AppendSeparator(); pSymbolsMenu->Append(IDM_LOADMAPFILE, _("&Load symbol map")); @@ -207,8 +198,25 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event) Profiler::g_ProfileBlocks = GetMenuBar()->IsChecked(IDM_PROFILEBLOCKS); break; case IDM_WRITEPROFILE: - Profiler::WriteProfileResults("profiler.txt"); - WxUtils::Launch("profiler.txt"); + if (jit != NULL) + { + std::string filename = File::GetUserPath(D_DUMP_IDX) + "Debug/profiler.txt"; + File::CreateFullPath(filename.c_str()); + Profiler::WriteProfileResults(filename.c_str()); + + wxFileType* filetype = NULL; + if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("txt")))) + { + // From extension failed, trying with MIME type now + if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromMimeType(_T("text/plain")))) + // MIME type failed, aborting mission + break; + } + wxString OpenCommand; + OpenCommand = filetype->GetOpenCommand(wxString::From8BitData(filename.c_str())); + if(!OpenCommand.IsEmpty()) + wxExecute(OpenCommand, wxEXEC_SYNC); + } break; } } @@ -227,10 +235,6 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) g_symbolDB.Clear(); Host_NotifyMapLoaded(); break; - case IDM_CLEANSYMBOLS: - g_symbolDB.Clear("zz"); - Host_NotifyMapLoaded(); - break; case IDM_SCANFUNCTIONS: { PPCAnalyst::FindFunctions(0x80000000, 0x81800000, &g_symbolDB); -- cgit v1.2.3