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
This commit is contained in:
tellowkrinkle 2021-11-19 20:35:50 -06:00 committed by GitHub
parent 6cd8b34abb
commit 9c0582a103
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 37 deletions

View File

@ -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.

View File

@ -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));
}

View File

@ -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);