From 9c0582a1033092e716d256de86b5b6d51abf72da Mon Sep 17 00:00:00 2001 From: tellowkrinkle Date: Fri, 19 Nov 2021 20:35:50 -0600 Subject: [PATCH] wx: Fix `pxExplore` on macOS (#4989) * wx: Fix `pxExplore` on macOS Trying to open file urls in a browser does not actually launch a file explorer in macOS * wx: Remove pxExplore/pxLaunch Was barely used --- pcsx2/gui/Panels/DirPickerPanel.cpp | 2 +- pcsx2/gui/wxGuiTools.cpp | 30 ----------------------------- pcsx2/gui/wxGuiTools.h | 6 ------ 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/pcsx2/gui/Panels/DirPickerPanel.cpp b/pcsx2/gui/Panels/DirPickerPanel.cpp index ca1e1461a3..8beb1c8c2a 100644 --- a/pcsx2/gui/Panels/DirPickerPanel.cpp +++ b/pcsx2/gui/Panels/DirPickerPanel.cpp @@ -78,7 +78,7 @@ void Panels::DirPickerPanel::Explore_Click( wxCommandEvent &evt ) path.Mkdir(); } - pxExplore( path.ToString() ); + wxLaunchDefaultApplication(path.ToString()); } // There are two constructors. See the details for the 'label' parameter below for details. diff --git a/pcsx2/gui/wxGuiTools.cpp b/pcsx2/gui/wxGuiTools.cpp index a7d5c59493..cc0f07790c 100644 --- a/pcsx2/gui/wxGuiTools.cpp +++ b/pcsx2/gui/wxGuiTools.cpp @@ -650,33 +650,3 @@ wxString pxGetAppName() pxAssert(wxTheApp); return wxTheApp->GetAppName(); } - - -// ------------------------------------------------------------------------ -// Launches the specified file according to its mime type -// -void pxLaunch(const wxString& filename) -{ - wxLaunchDefaultBrowser(filename); -} - -void pxLaunch(const char* filename) -{ - pxLaunch(fromUTF8(filename)); -} - -// ------------------------------------------------------------------------ -// Launches a file explorer window on the specified path. If the given path is not -// a qualified URI (with a prefix:// ), file:// is automatically prepended. This -// bypasses wxWidgets internal filename checking, which can end up launching things -// through browser more often than desired. -// -void pxExplore(const wxString& path) -{ - wxLaunchDefaultBrowser(!path.Contains(L"://") ? L"file://" + path : path); -} - -void pxExplore(const char* path) -{ - pxExplore(fromUTF8(path)); -} diff --git a/pcsx2/gui/wxGuiTools.h b/pcsx2/gui/wxGuiTools.h index ebf59779be..2688ef9b74 100644 --- a/pcsx2/gui/wxGuiTools.h +++ b/pcsx2/gui/wxGuiTools.h @@ -802,9 +802,3 @@ extern void pxSetToolTip(wxWindow& wind, const wxString& src); extern wxFont pxGetFixedFont(int ptsize = 8, wxFontWeight weight = wxFONTWEIGHT_NORMAL, bool underline = false); extern pxDialogCreationFlags pxDialogFlags(); - -extern void pxExplore(const wxString& path); -extern void pxExplore(const char* path); - -extern void pxLaunch(const wxString& path); -extern void pxLaunch(const char* path);